A complete asynchronous request example
- Last Updated: January 16, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
In the following example, the ABL client procedure, client.p, calls server.p (following) asynchronously on a server. The server.p procedure returns the customer number corresponding to a customer name provided by client.p.
The client.p procedure blocks and waits for the PROCEDURE-COMPLETE event that triggers execution of the OnProcedureComplete event method defined in the callbackHandlerObj ABL object, which is an instance of the
CallbackHandler class. The callbackHandlerObj method displays the customer number.
After the callback method executes, the client.p
procedure deletes the asynchronous request handle asyncRequest, the server connection handle appserverConnection and the callback method object instance callbackHandlerObj.
In a more typical example, additional event
handlers (triggers) would be active for user-interface events, allowing the user of
client.p to perform other tasks with the
procedure while completion of the request is pending. In this case, the client
application blocks immediately after submitting the request to wait for the result and
terminates after executing the callback method registered for the PROCEDURE-COMPLETE event.
client.p
|
server.p
|
CallbackHandler.cls
|