[zeromq-dev] Is there already native "high level" connection pool?

Ian Barber ian.barber at gmail.com
Tue Nov 27 14:57:11 CET 2012

On Tue, Nov 27, 2012 at 1:33 PM, Stefan de Konink <stefan at konink.de> wrote:

> On 11/27/12 13:49, Pieter Hintjens wrote:
> > Please explain what you are actually trying to achieve, not in terms
> > of 0MQ but in terms of the actual overall problem, and we'll be able
> > to help more.
> I would like to send an incomming HTTP POST to an undefined number of
> clients on the internet, having an envelope (the HTTP path) and data the
> HTTP POST. The two constraint of this process is minimizing latency and
> guaranteed delivery.
> In order to handle large HTTP POST each incomming HTTP request is
> compressed using gzip. When the request comes in, an envelope is send,
> with SND_MORE. The HTTP POST is compressed on the fly, each interation
> the webserver receives data on the socket for that request, gzip is
> called, and the partial result is send over a ZeroMQ socket using
> SND_MORE. When the HTTP POST is completely processed no SND_MORE flag is
> append.

So, for an example you might want to look at how Mongrel2 handles this kind
of thing. Messages flow across ZeroMQ with a connection ID and a body, and
get written to the appropriate HTTP connection. So, basically, don't use
SND_MORE to handle the stream, send each part individually, and include a
connection identifier as a message part within each one. As Michel says,
multipart messages are delivered atomically so they wont give you
the behaviour you are looking for, pooling or not.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20121127/6b6ab56f/attachment.htm>

More information about the zeromq-dev mailing list