[zeromq-dev] Stopping zmq_device
bwb at holo.org
Fri Jul 9 21:29:09 CEST 2010
On Jul 9, 2010, at 12:17 , Jarred Ward wrote:
> I think that forcibly releasing a blocking recv on a single thread from another thread with a socket interrupt makes the most sense. I think the recv should return an EIR (interrupt request) signalling that it was interrupted and the socket should remain usable afterward.
For the Ruby extension, it is also very desirable to have the ability to interrupt a blocking call on a socket. Ruby 1.9's API for blocking operations includes a callback that is invoked when the thread is to be interrupted/terminated (by another Ruby thread, or by Ctrl-C, or a signal handler...), but currently I can't implement this callback without turning all 0MQ calls into zmq_poll() calls and using my own notifier fd for each socket (ugly!)
So, it would be nice to have something like zmq_interrupt(socket) or zmq_abort(socket) that would cause any outstanding blocking calls on that socket to be resumed with errno = EINTR.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the zeromq-dev