Previous Topic: CHECK ASYNC RESPONSENext Topic: Request Identifier (IDENTIFIED BY:)


Syntax

+--CHECK ASYNC RESPONSE
| IDENTIFIED BY: viewname async_request
+--WHEN available
+--WHEN pending
+--WHEN invalid ASYNC_REQUEST_ID

An application can check the state of a given outstanding asynchronous request, without actually obtaining its associated response, by using the CHECK ASYNC RESPONSE statement. This statement executes as a non-blocking operation. The runtime interrogates the state of the specified request, then communicates that state to the application by passing control to one of the specified blocks of code that has been defined in the associated WHEN clauses of the statement.

If the application just needs to check the status of a response, using CHECK ASYNC RESPONSE is more efficient, and faster, than using GET ASYNC RESPONSE as it does not need to allocate (then de-allocate) any resources (for example, storage for the response message object).