[zeromq-dev] disabling receiving messages from queue

Pavel Gushcha pavimus at gmail.com
Tue Aug 4 15:32:28 CEST 2009


Can I disable receiving messages from spcecified queue by
api_thread_t::receive()?
Real use case: my application has one api_thread_t, it receives requests,
process it and sends responses. While processing request, it sends/receives
messages to another applications. I want to implement limit for number of
currently processing messages. Easiest implementation for me looks like
this: when number of currently processing request goes above limit, i block
receiving messages from requests queue. In this case only messages that used
in processing will be received, no new request messages.

Now i'm thinking about:
1) more complex realization with two api_thread_t, non-blocking receive()
and sleep() functions.
2) more complex realization with blocking receive() but with two application
threads with syncronization between them.

May be threre is more elegant solution for my situation?


Thanks for help!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20090804/65c99fd2/attachment.htm>


More information about the zeromq-dev mailing list