Differences between revisions 3 and 4
Revision 3 as of 2007-02-17 01:32:07
Size: 1523
Editor: interweb
Comment: deleting link spam
Revision 4 as of 2009-09-20 21:46:24
Size: 1501
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
[[BR]] <<BR>>
Line 8: Line 8:
[[BR]] <<BR>>
Line 10: Line 10:
[[BR]] <<BR>>
Line 16: Line 16:
[http://mail-archives.apache.org/mod_mbox/jakarta-httpclient-user/200601.mbox/%3c43DF7810.1040401@fz-juelich.de%3e Roger Menday] [[http://mail-archives.apache.org/mod_mbox/jakarta-httpclient-user/200601.mbox/%3c43DF7810.1040401@fz-juelich.de%3e|Roger Menday]]
Line 21: Line 21:
 * [wiki:Self:UseCases/SingleAsyncRequest single asynchronous request]
 * [wiki:Self:UseCases/MultiAsyncRequests multiple asynchronous requests] (pipelining)
 * [[UseCases/SingleAsyncRequest|single asynchronous request]]
 * [[UseCases/MultiAsyncRequests|multiple asynchronous requests]] (pipelining)
Line 27: Line 27:
Unlike the [wiki:Self:UseCases/SingleAsyncRequest single asynchronous request], this use case can not be handled Unlike the [[UseCases/SingleAsyncRequest|single asynchronous request]], this use case can not be handled

Use Case: Receive Response While Sending Request


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.


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


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)