From 781d71db20b0c5acbe940eff1b1ef2f1b765ce54 Mon Sep 17 00:00:00 2001 From: Yaroslav Brustinov Date: Wed, 1 Feb 2017 21:13:23 +0200 Subject: zmq os independent Change-Id: Iaf5a782be4db26a979a7535454719e8e62b5969a Signed-off-by: Yaroslav Brustinov --- .../ucs2/64bit/zmq/green/eventloop/__init__.py | 3 ++ .../ucs2/64bit/zmq/green/eventloop/ioloop.py | 33 ++++++++++++++++++++++ .../ucs2/64bit/zmq/green/eventloop/zmqstream.py | 11 ++++++++ 3 files changed, 47 insertions(+) create mode 100644 scripts/external_libs/pyzmq-14.5.0/python2/ucs2/64bit/zmq/green/eventloop/__init__.py create mode 100644 scripts/external_libs/pyzmq-14.5.0/python2/ucs2/64bit/zmq/green/eventloop/ioloop.py create mode 100644 scripts/external_libs/pyzmq-14.5.0/python2/ucs2/64bit/zmq/green/eventloop/zmqstream.py (limited to 'scripts/external_libs/pyzmq-14.5.0/python2/ucs2/64bit/zmq/green/eventloop') diff --git a/scripts/external_libs/pyzmq-14.5.0/python2/ucs2/64bit/zmq/green/eventloop/__init__.py b/scripts/external_libs/pyzmq-14.5.0/python2/ucs2/64bit/zmq/green/eventloop/__init__.py new file mode 100644 index 00000000..c5150efe --- /dev/null +++ b/scripts/external_libs/pyzmq-14.5.0/python2/ucs2/64bit/zmq/green/eventloop/__init__.py @@ -0,0 +1,3 @@ +from zmq.green.eventloop.ioloop import IOLoop + +__all__ = ['IOLoop'] \ No newline at end of file diff --git a/scripts/external_libs/pyzmq-14.5.0/python2/ucs2/64bit/zmq/green/eventloop/ioloop.py b/scripts/external_libs/pyzmq-14.5.0/python2/ucs2/64bit/zmq/green/eventloop/ioloop.py new file mode 100644 index 00000000..e12fd5e9 --- /dev/null +++ b/scripts/external_libs/pyzmq-14.5.0/python2/ucs2/64bit/zmq/green/eventloop/ioloop.py @@ -0,0 +1,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 diff --git a/scripts/external_libs/pyzmq-14.5.0/python2/ucs2/64bit/zmq/green/eventloop/zmqstream.py b/scripts/external_libs/pyzmq-14.5.0/python2/ucs2/64bit/zmq/green/eventloop/zmqstream.py new file mode 100644 index 00000000..90fbd1f5 --- /dev/null +++ b/scripts/external_libs/pyzmq-14.5.0/python2/ucs2/64bit/zmq/green/eventloop/zmqstream.py @@ -0,0 +1,11 @@ +from zmq.eventloop.zmqstream import * + +from zmq.green.eventloop.ioloop import IOLoop + +RealZMQStream = ZMQStream + +class ZMQStream(RealZMQStream): + + def __init__(self, socket, io_loop=None): + io_loop = io_loop or IOLoop.instance() + super(ZMQStream, self).__init__(socket, io_loop=io_loop) -- cgit 1.2.3-korg