hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Leigh <james-nos...@leighnet.ca>
Subject Re: Enabling HTTP Pipelining
Date Fri, 19 Mar 2010 19:24:49 GMT
On Fri, 2010-03-19 at 00:23 +0100, Oleg Kalnichevski wrote:
> On Thu, 2010-03-18 at 18:46 -0400, James Leigh wrote:
> > On Thu, 2010-03-18 at 23:27 +0100, Oleg Kalnichevski wrote:
> > > 
> > > James
> > > 
> > > Presently AsyncNHttpClientHandler does not support request pipelining, 
> > > as it pretty much mutually exclusive with 'expect: continue' 
> > > handshaking. You will have to develop a custom NHttpClientHandler 
> > > implementation if you need support for request pipelining.
> > > 
> > > Oleg
> > > 
> > 
> > Okay understood, but I could imagine a client handler that would support
> > both.
> 
> There is a very early prototype of an asynchronous HTTP client based on
> HttpCore NIO and HttpClient in SVN:
> 
> http://svn.apache.org/repos/asf/httpcomponents/asynchttpclient/trunk/   
> 
> I was thinking about adding support for request pipelining to it, if I
> ever get around to hacking on it again. 
> 
> 


I am going to stick with AsyncNHttpClientHandler for this project. How
does expect-continue work in AsyncNHttpClientHandler? Does it also use a
blocking interface?


> >  If I create a patch for AsyncNHttpClientHandler to switch between
> > HTTP pipelining and 'expect: continue' modes based on the presence or
> > absents of the expect header in the most recent request, would HttpCore
> > team consider it?
> > 
> 
> Absolutely.
> 
> > Also what about server side pipelining? Is there any way for
> > AsyncNHttpServiceHandler to support pipelining? Any hints on what would
> > need to change to support it?
> > 
> 
> It should not be that difficult, I believe. Essentially all it takes is
> an additional queue for pipelined requests and a piece of control logic
> that ensures the queue gets drained before a non-pipelineable request
> such as POST is processed.
> 
> I just never felt pipelining was that important to justify spending time
> and efforts on it and risk getting beaten by my wife.
> 
> Having said all that, I will happily review and apply a patch that adds
> pipelining capabilities.
> 

I'll see about sending you a patch this summer.

> > I notice that HttpExpectationVerifier is a blocking interface. Is there
> > an asynchronous alternative?
> > 
> 
> No, there is currently not. At the moment AsyncNHttpServiceHandler uses
> the same interface as the blocking protocol handler, which makes it
> unsuitable for non-trivial verification tasks such as credentials
> validation. Needs work.

This is what I suspected.

> > Thanks for such a good HTTP library!
> > 
> 
> I am glad you found HttpCore useful.
> 
> Cheers
> 
> Oleg
> 

Thanks,
James



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message