[rabbitmq-discuss] event-based use of the RabbitMQ C library

Tony Garnock-Jones tonygarnockjones+rabbitmq at gmail.com
Mon Feb 7 23:12:58 GMT 2011


On 6 February 2011 12:03, David Wragg <david at rabbitmq.com> wrote:

> librabbitmq does not currently support non-blocking operation.
>

Correct, but it permits it.


> As I said, it's a hack.
>

The alternative is to avoid use of the *_simple_* methods, including
amqp_simple_wait_frame, and to read bytes yourself in whatever way you see
fit (e.g. using libevent or raw select plus nonblocking sockets) and pass
those bytes to amqp_handle_input. You'll need to do the connection opening
and tuning yourself, but once that's done you're golden.


> > Are there examples anywhere of event-driven uses of the RabbitMQ C
> > library which send and receive on different channels on the same
> > connection based on some kind of external events?
>

Yes: https://github.com/tonyg/rais/blob/master/src/connection.c#L384-411

Regards,
  Tony
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110207/5622f265/attachment.htm>


More information about the rabbitmq-discuss mailing list