[zeromq-dev] pyzmq poller and EINTR
Doron Somech
somdoron at gmail.com
Wed Jan 16 09:14:57 CET 2019
Add another socket to the zmq_poll, which is a pair, just for signalling
the poll to stop.
When you want to stop it, send a signal from the paired socket, which you
can do from another thread.
On Tue, Jan 15, 2019 at 5:50 PM <Martin.Belanger at dell.com> wrote:
> The C library provides zmq_poll(), which returns -1 on error and set the
> errno accordingly. I'm particularly interested by errno=EINTR, which means:
> "The operation was interrupted by delivery of a signal before any events
> were available."
>
> Now if we look at the Python code there is zmq.Poller.poll(timeout=None).
> This functions returns the list of events that are ready to be processed.
> There is no mention of how zmq.Poller.poll() behaves when a signal is
> received. In fact, I did a test and it seems that zmq.Poller.poll() simply
> cannot be interrupted. I need to implement a loop that is waiting forever
> on a couple of sockets. However, I want to be able to send a signal
> (HANGUP) to that process to tell it to stop polling and reload its
> configuration. Please let me know how I can do this.
>
> Thanks.
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20190116/223dc18e/attachment.htm>
More information about the zeromq-dev
mailing list