__init__.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # -*- coding: utf-8 -*-
  2. #-----------------------------------------------------------------------------
  3. # Copyright (C) 2011-2012 Travis Cline
  4. #
  5. # This file is part of pyzmq
  6. # It is adapted from upstream project zeromq_gevent under the New BSD License
  7. #
  8. # Distributed under the terms of the New BSD License. The full license is in
  9. # the file COPYING.BSD, distributed as part of this software.
  10. #-----------------------------------------------------------------------------
  11. """zmq.green - gevent compatibility with zeromq.
  12. Usage
  13. -----
  14. Instead of importing zmq directly, do so in the following manner:
  15. ..
  16. import zmq.green as zmq
  17. Any calls that would have blocked the current thread will now only block the
  18. current green thread.
  19. This compatibility is accomplished by ensuring the nonblocking flag is set
  20. before any blocking operation and the ØMQ file descriptor is polled internally
  21. to trigger needed events.
  22. """
  23. from zmq import *
  24. from zmq.green.core import _Context, _Socket
  25. from zmq.green.poll import _Poller
  26. Context = _Context
  27. Socket = _Socket
  28. Poller = _Poller
  29. from zmq.green.device import device