[zeromq-dev] design check question: inproc priority queue

Michael Haberler mail17 at mah.priv.at
Sun Aug 26 12:30:01 CEST 2012

I need an in-process priority queue
just two priorities needed: presto and cattle-class
consumer shall always process presto messages until presto queue empty, then may continue on cattle-class queue entries.

q1: would this setup be the way to go:

- two inproc sockets, one for presto, one for cattle-class
- consumer zmq_poll()s on both queueus
- consumer acts on presto socket readable first, and loops there until presto queue empty
- return to main zmq_poll() loop

makes sense y/n?

q2: it is unclear to me how to flush a queue - some priority messages imply flushing the non-prioritiy queue, for instance a message meaning 'program abort'.

do I just read and throw away messages in the consumer? strikes me as inelegant.

thanks in advance,


More information about the zeromq-dev mailing list