Skip to content

Overview

Concepts and Principles

Development

Overview

IDEs

API Explorer

Releases

Release Notes

TORO Integrate

Coder Studio

Coder Cloud

Bug Reports

Search

Using Asynchronous Gloop Steps

Introduction

Asynchronous steps are Gloop steps that run in a separate thread, enabling the service to continue to the next step without having to wait for the asynchronous step to finish first.

The examples package demonstrates the use of the Asynchronous property to allow for asynchronous steps via the AsyncStepDemo.gloop service.

Related articles

Please see the following articles for more information:

Running the Service

Under the Coder Navigator, expand the examples package entry and navigate to the code folder. Afterwards, look for the asyncStep package. This package contains three files, shown below:

1
2
3
4
5
6
7
examples
├── ...
└── code
    └── asyncStep
        ├── AsyncStepDemo.gloop
        ├── Countdown.gloop
        └── GetPackagePropertyAsync.gloop

Running the AsyncStepDemo.gloop service will produce an output similar to that of below:

AsyncStepDemo.gloop's console outputs

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
05/03/18 10:07:09.036 INFO  [Integrate] asyncStepDemo: I will now start countdown.gloop asynchronously
05/03/18 10:07:09.043 INFO  [Integrate] asyncStepDemo: Countdown should still be running after this. If not, please
invoke asyncStepDemo.gloop from the browser
>>>>ESBPackage [name=examples]
05/03/18 10:07:09.055 INFO  [Integrate] exampleProperty is: example value
05/03/18 10:07:09.195 INFO  [Integrate] countdown: Current count is 0
05/03/18 10:07:09.349 INFO  [Integrate] countdown: Current count is 1
05/03/18 10:07:09.505 INFO  [Integrate] countdown: Current count is 2
05/03/18 10:07:09.660 INFO  [Integrate] countdown: Current count is 3
...
05/03/18 10:07:12.942 INFO  [Integrate] countdown: Finished counting

How It Works...

The AsyncStepDemo.gloop service demonstrates how Gloop behaves when it is asked to invoke services asynchronously. Gloop allows concurrent and invoke steps to run asynchronously.

Not really asynchronous when debugging

Please take note that due to some limitations in the Coder debugger, asynchronous steps are executed synchronously when debugging. If you'd like to test asynchronous steps in an asynchronous fashion, the Invoke in Browser option should be used to invoke the Gloop service. To do this, right-click the service and select Invoke In Browser from the context menu.

*Invoke in Browser* option as seen in context menu