Use Case: Single Asynchronous Request


I want to send a request for which I expect a long response time without blocking the application immediately.
Later, when my application needs the response, it will receive the response with a blocking operation.


This is the most basic case of asynchronous communication, possibly useful if the request includes a large body or if the server is expected to respond with a huge delay. It can be used to interlock HTTP communication with something else, but eventually the application has to receive the response synchronously, which limits the applicability.

The focus of this use case is the design of an interface for sending the request asynchronously, and for receiving the response synchronously. An initial implementation of that interface could spawn a background thread for each request that is sent. The responsibility for processing of the response headers can be assigned to the application thread as well as to the background thread.

UseCases/SingleAsyncRequest (last edited 2009-09-20 21:46:22 by localhost)