[rabbitmq-discuss] Regarding the non-blocking call of "amqp_simple_wait_frame"

Scott Brooks scott at beamdog.com
Mon Jan 17 17:20:15 GMT 2011


I used a combination of select() on the socket, and
amqp_frames_enqueued() when working on a ruby/FFI implementation

If there were frames enqueued, call amqp_simple_wait_frame() because
it will just return from that.
If there are no frames enqueued, check the socket with select, and if
there's data, call amqp_simple_wait_frame()

Ruby(1.8) uses green threads, so any blocking IO would block the whole process.

Scott Brooks

On Mon, Jan 17, 2011 at 2:26 AM, Deepak Vijayvergiy
<vdeepak at yahoo-inc.com> wrote:
> Hello,
> I am implementing RabbitMQ-C client library in my c++ project and I have a
> question about the message reading from the queue.
> We need to call the function amqp_simple_wait_frame(), and we are blocked
> here to get the result, and then return  when we get the message.
> Question is: Do you also have some other way in which we can read the
> message without blocking?
> Thanks
> Regards
> Deepak
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>


More information about the rabbitmq-discuss mailing list