pyams_zmq package¶
+Subpackages¶
+ +Submodules¶
+pyams_zmq.handler module¶
+ + +pyams_zmq.process module¶
+-
+
-
+class
pyams_zmq.process.
ZMQProcess
(bind_addr, handler)¶
+ Bases:
+multiprocessing.context.Process
This is the base for all processes and offers utility methods +for setup and creating new streams.
+-
+
-
+
context
= None¶
+ The ØMQ
+Context
instance.
-
+
-
+
exit
(num, frame)¶
+
-
+
-
+
initStream
()¶
+ Initialize response stream
+
-
+
-
+
loop
= None¶
+ PyZMQ’s event loop (
+IOLoop
).
-
+
-
+
run
()¶
+ Sets up everything and starts the event loop.
+
-
+
-
+
socket_type
= 4¶
+
-
+
-
+
stop
()¶
+ Stops the event loop.
+
-
+
-
+
stream
(sock_type, addr, bind, callback=None, subscribe=b'')¶
+ Creates a
+ZMQStream
.+
++ + + +Parameters: +-
+
- sock_type – The ØMQ socket type (e.g.
zmq.REQ
)
+ - addr –
Address to bind or connect to formatted as host:port, +(host, port) or host (bind to random port). +If bind is
+True
, host may be:-
+
- the wild-card
*
, meaning all available interfaces,
+ - the primary IPv4 address assigned to the interface, in its +
numeric representation or +- the interface name as defined by the operating system.
+If bind is
+False
, host may be:-
+
- the DNS name of the peer or +
- the IPv4 address of the peer, in its numeric representation. +
If addr is just a host name without a port and bind is +
+True
, the socket will be bound to a random port.
+ - the wild-card
- bind – Binds to addr if
True
or tries to connect to it +otherwise.
+ - callback – A callback for
+
on_recv()
, optional
+ - subscribe – Subscription pattern for SUB sockets, optional,
+defaults to
b''
.
+
+ +Returns: +A tuple containg the stream and the port number.
+- sock_type – The ØMQ socket type (e.g.
-
+
-
+
-
+
pyams_zmq.process.
process_exit_func
(process=None)¶
+