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 <[email protected]> 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 > [email protected] > https://lists.zeromq.org/mailman/listinfo/zeromq-dev >
_______________________________________________ zeromq-dev mailing list [email protected] https://lists.zeromq.org/mailman/listinfo/zeromq-dev
