hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Are requests and responses self-contained?
Date Wed, 03 Aug 2011 11:08:53 GMT

> > 
> > Yes, you do. One thing I do not understand, though. Why don't you simply
> > use two connections if you really need to process two messages
> > concurrently?
> > 
> > Oleg
> > 
> > 
> 
> I'm implementing a load balancer.
> 
> Requests from browsers are first put on a common queue by producer
> tasks. Requests can be part of a HTTP pipeline. Consumer tasks then take
> them from the queue to send them to available web servers from a pool.
> Requests from the same pipeline can be sent to different servers.
> 
> A similar processing happens for responses. In case a server crashes,
> the requests sent to it that did not get a response are reallocated to
> the other consumer tasks to be resent to the other servers.
> 
> Hence, processing is decoupled between the client tasks and the server
> tasks and is thus asynchronous. I need to preserve the requests to
> resend them in case of server failure and also need to preserve
> responses to guarantee the right delivery order of HTTP pipelines.
> Responses for the same pipeline can arrive to the load balancer out of
> order.
> 

This still does not explain why you want to read two requests from the
same connection at the _same_ time. Anyway, if you want to be able to
repeat requests there is no way around buffering content in memory or on
disk.

Oleg


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


Mime
View raw message