Using Asynchronous Gloop Steps
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.
examples package demonstrates the use of the
Asynchronous property to allow for asynchronous
steps via the
Please see the following articles for more information:
Running the Service
1 2 3 4 5 6 7
examples ├── ... └── code └── asyncStep ├── AsyncStepDemo.gloop ├── Countdown.gloop └── GetPackagePropertyAsync.gloop
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...
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 (or Invoke in New Tab) option should be used to invoke the Gloop service. To do this, right-click the service and select Invoke In Browser (or Invoke in New Tab) from the context menu.