zeromq/pyzmq — pull request #297 by jordens (2013-01-24 01:57:29+00:00)
Title: break out of the ioloop only after the iteration

loop.add_timeout(0, loop.stop) will otherwise interrupt the loop
mid-flight (as opposed to the docstring) and handlers on the sockets
will never be called.

zmq/eventloop/ioloop.py: move the break to the end of the loop
zmq/tests/test_ioloop.py: add test for this