Managing asynchronous requests
- Last Updated: March 30, 2020
- 2 minute read
- OpenEdge
- Version 12.2
- Documentation
As indicated previously, you can invoke Web service requests asynchronously from ABL. This
means that you can invoke a Web service request in such a way that the result is handled
independently of the mainline flow of execution. That is, ABL statements following the
asynchronous request execute immediately and in order without waiting for the result of the
asynchronous request to be available. Instead, the asynchronous request specifies an internal
event procedure to handle the result when the result for that asynchronous request becomes
available, which is signalled by the activation of a PROCEDURE-COMPLETE
event.
When it is time to handle the PROCEDURE-COMPLETE event, the specified event
procedure executes and manages any OUTPUT or INPUT-OUTPUT
parameters that were passed to the asynchronous request when it was invoked. These parameters
are returned as INPUT parameters to the event procedure, which can store the
parameter values or otherwise process the result for use by the mainline program. The mainline
program can periodically inspect an asynchronous request object handle (also available to the
event procedure), which it sets during invocation of the request, in order to determine if the
specified asynchronous request has completed. If the request has completed, the program can
then make use of the results as provided by the internal event procedure that handled
them.
The model for asynchronous Web service request invocation is very similar to the model for asynchronous remote procedure invocation on a session-free AppServer. This section describes the asynchronous Web service calling model, noting any differences from the asynchronous session-free AppServer calling model. For information on the model for invoking asynchronous requests on a session-free AppServer, see OpenEdge Application Server: Developing AppServer Applications.