[zeromq-dev] Announcing em-zeromq, integration with ruby's eventmachine reactor
Jonathan Rockway
jon at jrock.us
Sun Jan 30 09:01:49 CET 2011
* On Sat, Jan 29 2011, Andrew Cholakian wrote:
> Thanks Jonathan, I appreciate the detailed comments and insights and will definitely be
> making the changes you've recommended.
>
> As far as ZMQ::Events goes. Why should I check that rather than just
> attempt to call recv, ZMQ::NOBLOCK, as the code does now? I left that
> comment in there because I was a bit confused as to why I should check
> that. It sounds like there's a good reason for that, but I'm clearly
> not getting something.
I think it's OK to do what you're doing; try the read or write, and if
it fails, make a note and try again when the IO watcher fires. What
won't work is just creating an IO watcher on the ZMQ_FD without either
checking ZMQ_EVENTS or trying a no-block read/write. (I think that's
how Praveen ran into trouble when he was trying to integrate with
libev.)
If someone will ack this, I'll write up some documentation and a C-based
example on how to correctly integrate zmq >= 2.1.0 with an arbitrary
event loop. Hopefully that will save others some time.
Regards,
Jonathan Rockway
--
print just => another => perl => hacker => if $,=$"
More information about the zeromq-dev
mailing list