In general, asynchronous processing is based on a similar concept of a cooperative flow (that is, request/response). However, asynchronous processing lets you decouple the handling of the request from the handling of the response. The effect of an asynchronous request is to initiate the server processing. The requesting application must then explicitly retrieve (or ignore) the associated asynchronous response of the request.
To allow the separation of request and response, an asynchronous cooperative flow involves several stages that are shown in the following illustration:

The request stage comprises the initiating request for the asynchronous flow (stage 1a) followed by a request to the server to process the request (stage 1b). The scope of the initiating request (stage 1a) depends the middleware being used, the middleware being the deciding factor on where the handover from stage 1a to stage 1b occurs. The retrieval stage (stage 2) comprises a request from the client to retrieve, or check the status of, the supplied response.
An asynchronous cooperative flow is initiated using a USE ASYNC statement. The options available with this command and the corresponding response commands are explained in the Action Diagram User Guide.
The processing of a USE ASYNC statement passes control to various runtime components and the supporting runtime code executes the code that actually initiates the flow to the target DPS. During the flow, the communications runtime code reaches a point in its processing where the request is considered accepted. This point can vary depending on the middleware environment being used. In most cases, the point of acceptance occurs when the communications code has sent the request to the target server environment. When the request is accepted, the runtime returns control to the initiating application, thus allowing processing to proceed. The supporting runtime continues to process the outstanding request and prepares to handle the associated response as directed by the initiating USE ASYNC statement.
A DPS application that is the target of an asynchronous cooperative flow behaves the same as if it were the target of a synchronous request. An exception is if the target DPS application is being invoked as a no response asynchronous request. In this case, the response buffer is not sent to the invoking DPC application.
|
Copyright © 2014 CA.
All rights reserved.
|
|