This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!
Project Description

Zantedeschia is an experimental alternative integration between asyncio and ZeroMQ sockets.

I started trying to use aiozmq, but I objected to some of the design decisions. I borrowed ideas from that code, but did a few things differently:

  1. aiozmq is built around asyncio’s protocol and transport APIs, which I find hard to use; even the simplest examples involve subclassing ZmqProtocol. Zantedeschia uses a single AsyncZMQSocket wrapper class, with simple semantics.
  2. Zantedeschia does not include an RPC framework.
  3. Zantedeschia expects the user to create and connect ZMQ sockets using PyZMQ, then wrap them in an AsyncZMQSocket object.

Zantedeschia is a genus of flowers. Asyncio itself was originally codenamed ‘tulip’, and a tradition developed of naming asyncio libraries after flowers.

Use this at your own risk. MinRK, the author of PyZMQ, told me that I definitely shouldn’t rely on the ZMQ file descriptors for an event loop, but I’m doing exactly that.

Ping server example:

import asyncio, zmq, zantedeschia

ctx = zmq.Context()
s = ctx.socket(zmq.REP)
s.bind('tcp://127.0.0.1:8123')
async_sock = zantedeschia.AsyncZMQSocket(s)

def pong():
    while True:
        msg_parts = yield from async_sock.recv_multipart()
        yield from async_sock.send_multipart(msg_parts)

asyncio.get_event_loop().run_until_complete(pong())

Using the on_recv API instead:

import asyncio, zmq, zantedeschia

ctx = zmq.Context()
s = ctx.socket(zmq.REP)
s.bind('tcp://127.0.0.1:8123')
async_sock = zantedeschia.AsyncZMQSocket(s)

@async_sock.on_recv
def pong(msg_parts):
    async_sock.send_multipart(msg_parts)

asyncio.get_event_loop().run_forever()
Release History

Release History

0.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
Zantedeschia-0.1.tar.gz (4.0 kB) Copy SHA256 Checksum SHA256 Source Feb 9, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting