~ubuntu-branches/ubuntu/precise/pyzmq/precise

« back to all changes in this revision

Viewing changes to zmq/devices/monitoredqueue.pyx

  • Committer: Package Import Robot
  • Author(s): Debian Python Modules Team
  • Date: 2011-09-23 00:16:39 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: package-import@ubuntu.com-20110923001639-girjqodpb7uv17yu
Tags: 2.1.9-1
* New upstream version
  - should build on kFreeBSD without patches (Closes: #637777).
* Build-depend on zeromq 2.1.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    ctypedef int Py_ssize_t
34
34
 
35
35
from buffers cimport asbuffer_r
36
 
from czmq cimport *
 
36
from libzmq cimport *
37
37
 
38
38
from zmq.core.socket cimport Socket
39
39
 
40
 
from zmq.core import XREP, ZMQError
 
40
from zmq.core import ROUTER, ZMQError
41
41
 
42
42
#-----------------------------------------------------------------------------
43
43
# MonitoredQueue functions
58
58
    multipart.
59
59
    
60
60
    The only difference between this and a QUEUE as far as in/out are
61
 
    concerned is that it works with two XREP sockets by swapping the IDENT
 
61
    concerned is that it works with two ROUTER sockets by swapping the IDENT
62
62
    prefixes.
63
63
    
64
64
    Parameters
92
92
        if not isinstance(prefix, bytes):
93
93
            raise TypeError("prefix must be bytes, not %s"%type(prefix))
94
94
 
95
 
    # force swap_ids if both XREP
96
 
    swap_ids = (in_socket.socket_type == XREP and 
97
 
                out_socket.socket_type == XREP)
 
95
    # force swap_ids if both ROUTER
 
96
    swap_ids = (in_socket.socket_type == ROUTER and 
 
97
                out_socket.socket_type == ROUTER)
98
98
    
99
99
    # build zmq_msg objects from str prefixes
100
100
    asbuffer_r(in_prefix, <void **>&msg_c, &msg_c_len)
117
117
        rc = c_monitored_queue(ins, outs, mons, &in_msg, &out_msg, swap_ids)
118
118
    return rc
119
119
 
120
 
__all__ = ['monitored_queue']
 
 
b'\\ No newline at end of file'
 
120
__all__ = ['monitored_queue']