ZeroMQ integration with asyncio (PEP 3156).



The library works on Linux, MacOS X and Windows.

But Windows is a second-class citizen in ZeroMQ world, sorry.

Thus aiozmq has limited support for Windows also.

Limitations are:

Library Installation

The core requires only pyzmq and can be installed (with pyzmq as dependency) by executing:

pip3 install aiozmq

Also probably you want to use aiozmq.rpc.

RPC module is optional and requires msgpack. You can install msgpack-python by executing:

pip3 install msgpack-python


aiozmq can be executed by Python 3 only. The most Linux distributions uses pip3 for installing Python 3 libraries. But your system may be using Python 3 by default than try just pip instead of pip3. The same may be true for virtualenv, travis continuous integration system etc.

Source code

The project is hosted on GitHub

Please feel free to file an issue on bug tracker if you have found a bug or have some suggestion for library improvement.

The library uses Travis for Continious Integration.


  • Python 3.3 and asyncio or Python 3.4+
  • ZeroMQ 3.2+
  • pyzmq 13.1+ (did not test with earlier versions)
  • aiozmq.rpc requires msgpack

Authors and License

The aiozmq package is initially written by Nikolay Kim, now maintained by Andrew Svetlov. It’s BSD licensed and freely available. Feel free to improve this package and send a pull request to GitHub.

Getting Started

Example of RPC usage:

import aiozmq.rpc

class ServerHandler(aiozmq.rpc.AttrHandler):
    def remote_func(self, a:int, b:int) -> int:
        return a + b

def go():
    server = yield from aiozmq.rpc.serve_rpc(
        ServerHandler(), bind='tcp://')
    client = yield from aiozmq.rpc.connect_rpc(

    ret = yield from client.rpc.remote_func(1, 2)
    assert 3 == ret




To execute the example you need to install msgpack first.