eventlet/eventlet — pull request #4 by geoffsalmon (2012-12-27 23:42:24+00:00)
Title: zmq: fix spurious wakeups

I think this fixes https://bitbucket.org/which_linden/eventlet/issue/128/zeromq-fd-can-be-readable-without-being

This calls _Socket_getsockopt(self, EVENTS) in the event handler to process the waiting events if no reader or writer greenthreads are woken. Normally, if there is a reader or writer then calling socket.send or socket.recv would process the events and stop the event FD from being constantly readable. For cases where zeromq generates events that aren't related to reading or writing, we still need to process the events to avoid repeated, spurious wakeups.