examples
package: Using asynchronous Gloop Invoke steps
Asynchronous Gloop invoke steps are Gloop steps that invoke the target service in a separate thread, enabling the main service to continue to the next step without having to wait for the asynchronous step to finish first. Asynchronous invoke steps appear with no output in the Mapper (since they run in a separate thread and the outputs aren't used), and they appear in the service editor with green thread badges on the top right-hand corner (as shown below on lines 3-6).
The examples
package demonstrates the use of asynchronous steps in the
asyncStep.AsyncStepDemo.gloop
service.
Related articles
Please see the following articles for more information:
Try it!
In the Navigator, expand the examples
package and navigate to the
code
folder, then expand the asyncStep
package. This package contains three files,
as shown below:
1 2 3 4 5 6 7 8 9 |
|
Running the AsyncStepDemo.gloop
service will produce an output similar to the logs below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
Explanation
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 in order to make debugging services easier in Martini, 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 HTTP Client) option should be used when calling the service. To do this, right-click the service and select Invoke In Browser (or Invoke in HTTP Client) from the context menu.
In Martini Desktop, you can also drag and drop the service to the HTTP Client as shown here.