Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jakarta-httpclient 
Wiki" for change notification.

The following page has been changed by RolandWeber:
http://wiki.apache.org/jakarta-httpclient/HttpAsyncThreadingDesign

The comment on the change is:
added 'application considerations' to API description

------------------------------------------------------------------------------
  {{{HttpHandle.close}}} to be called, but that is not guaranteed by the API.
  
  
+ === Application Considerations ===
+ 
+ Applications using HttpAsync have one very important responsibility which was
+ not been mentioned so far. It may sound trivial, but really it isn't:
+ 
+  Applications '''must''' process responses as they arrive.
+ 
+ Due to the asynchronous nature of HttpAsync, an application can generate 
several
+ requests and pass them to a dispatcher. HttpAsync does ''not'' guarantee that 
these
+ requests will be sent in order. Responses may arrive in any order (even 
different
+ from the order in which requests are sent), and each response with an entity 
locks up
+ one connection until it is processed.
+ [[BR]]
+ Theoretically, notification is optional. An application thread can block on 
the
+ handle for a request until that specific response arrives. But since the order
+ in which requests are sent is not guaranteed, it can happen that other 
responses
+ which are not processed by the application lock up all connections, and that 
the
+ one request on which the application waits will never be sent. Even if this
+ deadlock scenario does not occur, blocked connections will degrade 
performance.
+ [[BR]]
+ Probability theory tells us that what can happen will happen eventually.
+ Murphy's Law tells us that what can go wrong will go wrong, in the worst 
possible moment.
+ Therefore, applications that generate more than one request per thread at a 
time
+ '''must''' use notification in order to process responses on arrival.
+ 
+ 
  == Blocking IO Implementation ==
  
  === Red Design ===

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to