New in version 15.0.
As of pyzmq 15, there is a new Socket subclass that returns Futures for recv methods,
which can be found at
You can create these sockets by instantiating a
from the same module.
These sockets let you easily use zmq with tornado’s coroutines.
from tornado import gen from zmq.eventloop.future import Context ctx = Context() @gen.coroutine def recv_and_process(): sock = ctx.socket(zmq.PULL) sock.bind(url) msg = yield sock.recv_multipart() # waits for msg to be ready reply = yield async_process(msg) yield sock.send_multipart(reply)
Socket subclass that returns
Future s from blocking methods,
for use in coroutines and async applications.
zmq.Socket for the inherited API.