decorators¶
Module: zmq.decorators
¶
Decorators for running functions with context/sockets.
New in version 15.3.
Like using Contexts and Sockets as context managers, but with decorator syntax. Context and sockets are closed at the end of the function.
For example:
from zmq.decorators import context, socket
@context()
@socket(zmq.PUSH)
def work(ctx, push):
...