~ubuntu-branches/ubuntu/trusty/pyzmq/trusty

« back to all changes in this revision

Viewing changes to zmq/green/__init__.py

  • Committer: Package Import Robot
  • Author(s): Julian Taylor
  • Date: 2013-02-24 19:23:15 UTC
  • mfrom: (2.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20130224192315-9xkzrza97h674d07
Tags: 2.2.0.1-1
* New upstream release
* relicense debian packaging to LGPL-3
* update watch file to use github directly
  thanks to Bart Martens for the file
* add autopkgtests
* drop obsolete DM-Upload-Allowed
* bump standard to 3.9.4, no changes required

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
12
"""zmq.green - gevent compatibility with zeromq.
 
13
 
 
14
Usage
 
15
-----
 
16
 
 
17
Instead of importing zmq directly, do so in the following manner:
 
18
 
 
19
..
 
20
 
 
21
    import zmq.green as zmq
 
22
 
 
23
 
 
24
Any calls that would have blocked the current thread will now only block the
 
25
current green thread.
 
26
 
 
27
This compatibility is accomplished by ensuring the nonblocking flag is set
 
28
before any blocking operation and the ØMQ file descriptor is polled internally
 
29
to trigger needed events.
 
30
"""
 
31
 
 
32
from zmq import *
 
33
from zmq.green.core import _Context, _Socket
 
34
from zmq.green.poll import _Poller
 
35
Context = _Context
 
36
Socket = _Socket
 
37
Poller = _Poller
 
38