Use Case: Receive Response While Sending Request

Description

I have to send a big request entity to the server, and expect a big response entity in return.
The server does not wait for the end of the request before starting to send the response.
I want to start receiving the response as soon as possible, not waiting for the request to be send completely.
Otherwise, a lot of data would need to be buffered somewhere along the line.

Background

This use case was contributed by Roger Menday on the user mailing list.

Discussion

Unlike the single asynchronous request, this use case can not be handled by a background thread that alternatingly sends and receives. Two threads are needed, one for sending and one for receiving. They have to synchronize with eachother in order to achieve one of the following:

  1. requests are not sent until the response for the previous one has been processed completely (no pipelining)
  2. responses are correctly matched to the requests that were sent (pipelining)

This use case provides an intermediate step on the road to implement full support for pipelining.

UseCases/AsyncReceiveWhileSending (last edited 2009-09-20 21:46:24 by localhost)