The zmq module wraps the Socket and Context found in pyzmq to be non blocking
Subclass of zmq.core.context.Context
Bases: zmq.sugar.socket.Socket
Green version of :class:`zmq.core.socket.Socket
To ensure that the zmq.NOBLOCK flag is set and that sending or recieving is deferred to the hub (using eventlet.hubs.trampoline()) if a zmq.EAGAIN (retry) error is raised
Receive a message.
Send a message on this socket.
This queues the message to be sent by the IO thread at a later time.
pyzmq [1] Is a python binding to the C++ ØMQ [2] library written in Cython [3]. The following is auto generated pyzmq's from documentation.
Context(io_threads=1)
Manage the lifecycle of a 0MQ context.
Close all sockets associated with this context, and then terminate the context. If linger is specified, the LINGER sockopt of the sockets will be set prior to closing.
WARNING:
destroy involves calling zmq_close(), which is NOT threadsafe. If there are active sockets in other threads, this must not be called.
Get the value of a context option.
See the 0MQ API documentation for zmq_ctx_get for details on specific options.
New in libzmq-3.2
The option to get. Available values will depend on your version of libzmq. Examples include:
zmq.IO_THREADS, zmq.MAX_SOCKETS
Set context options.
See the 0MQ API documentation for zmq_ctx_set for details on specific options.
New in libzmq-3.2
The option to set. Available values will depend on your version of libzmq. Examples include:
zmq.IO_THREADS, zmq.MAX_SOCKETS
Close or terminate the context.
This can be called to close the context by hand. If this is not called, the context will automatically be closed when it is garbage collected.
Socket(context, socket_type)
A 0MQ socket.
These objects will generally be constructed via the socket() method of a Context object.
Note: 0MQ Sockets are not threadsafe. DO NOT share them across threads.
.Context.socket : method for creating a socket bound to a Context.
[1] | http://github.com/zeromq/pyzmq |
[2] | http://www.zeromq.com |
[3] | http://www.cython.org |