You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Asankha C. Perera" <as...@apache.org> on 2010/01/24 06:55:51 UTC

Best way to handle or disable Pipelined requests

Hi Oleg

In the HttoCore Tutorial I see the following

"This makes non-blocking HTTP connections fully pipelining capable, but
at same time implies that this is the job of the protocol handler to
match logically related request and the response messages."

Is there any recommended way to handle - or - a simple way to disable
support for pipelined requests?

thanks
asankha


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


Re: Best way to handle or disable Pipelined requests

Posted by "Asankha C. Perera" <as...@apache.org>.
Hi Oleg
> On Mon, 2010-01-25 at 15:16 +0530, Asankha C. Perera wrote:
>   
>> Hi Oleg
>>     
>>> If you do not want to support request pipelining, simply disable input
>>> while processing an incoming message: disable input events immediately
>>> after having received a complete incoming request by calling
>>> IOControl#suspendInput(), process the request, generate a response,
>>> write it out, and finally re-enable input events when ready to receive
>>> another request by calling IOControl#requestInput().
>>>   
>>>       
>> I assumed this too.. but was wondering that if requests were really
>> pipelined (say as a series of GETs), it would be too late to
>> suspendInput while processing the first request - I guess I was wrong,
>> and the above will work as expected..
>>
>>     
>
> It can well happen that multiple pipelined requests end up read into the
> session input buffer. As long as the protocol handler does not act upon
> that data there should be no problem, though. 
>   

That sounds perfect!

many thanks
asankha

Re: Best way to handle or disable Pipelined requests

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, 2010-01-25 at 15:16 +0530, Asankha C. Perera wrote:
> Hi Oleg
> > If you do not want to support request pipelining, simply disable input
> > while processing an incoming message: disable input events immediately
> > after having received a complete incoming request by calling
> > IOControl#suspendInput(), process the request, generate a response,
> > write it out, and finally re-enable input events when ready to receive
> > another request by calling IOControl#requestInput().
> >   
> I assumed this too.. but was wondering that if requests were really
> pipelined (say as a series of GETs), it would be too late to
> suspendInput while processing the first request - I guess I was wrong,
> and the above will work as expected..
> 

It can well happen that multiple pipelined requests end up read into the
session input buffer. As long as the protocol handler does not act upon
that data there should be no problem, though. 

Cheers

Oleg 


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



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


Re: Best way to handle or disable Pipelined requests

Posted by "Asankha C. Perera" <as...@apache.org>.
Hi Oleg
> If you do not want to support request pipelining, simply disable input
> while processing an incoming message: disable input events immediately
> after having received a complete incoming request by calling
> IOControl#suspendInput(), process the request, generate a response,
> write it out, and finally re-enable input events when ready to receive
> another request by calling IOControl#requestInput().
>   
I assumed this too.. but was wondering that if requests were really
pipelined (say as a series of GETs), it would be too late to
suspendInput while processing the first request - I guess I was wrong,
and the above will work as expected..

thanks
asankha

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


Re: Best way to handle or disable Pipelined requests

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Sun, 2010-01-24 at 11:25 +0530, Asankha C. Perera wrote:
> Hi Oleg
> 
> In the HttoCore Tutorial I see the following
> 
> "This makes non-blocking HTTP connections fully pipelining capable, but
> at same time implies that this is the job of the protocol handler to
> match logically related request and the response messages."
> 
> Is there any recommended way to handle - or - a simple way to disable
> support for pipelined requests?
> 

Hi Asankha

If you do not want to support request pipelining, simply disable input
while processing an incoming message: disable input events immediately
after having received a complete incoming request by calling
IOControl#suspendInput(), process the request, generate a response,
write it out, and finally re-enable input events when ready to receive
another request by calling IOControl#requestInput().

Hope this helps

Cheers

Oleg


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



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