/usr/lib/python2.7/dist-packages/zmq/green/eventloop/ioloop.py is in python-zmq 15.2.0-0ubuntu4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | from zmq.eventloop.ioloop import *
from zmq.green import Poller
RealIOLoop = IOLoop
RealZMQPoller = ZMQPoller
class IOLoop(RealIOLoop):
def initialize(self, impl=None):
impl = _poll() if impl is None else impl
super(IOLoop, self).initialize(impl)
@staticmethod
def instance():
"""Returns a global `IOLoop` instance.
Most applications have a single, global `IOLoop` running on the
main thread. Use this method to get this instance from
another thread. To get the current thread's `IOLoop`, use `current()`.
"""
# install this class as the active IOLoop implementation
# when using tornado 3
if tornado_version >= (3,):
PollIOLoop.configure(IOLoop)
return PollIOLoop.instance()
class ZMQPoller(RealZMQPoller):
"""gevent-compatible version of ioloop.ZMQPoller"""
def __init__(self):
self._poller = Poller()
_poll = ZMQPoller
|