Skip to main content

Asynchronous channels and utilities.

Project description

Asynchronous channels for communication and synchronization between asyncio coroutines.

from asyncio_channel import create_channel

# Create a new channel.
ch = create_channel()

# Put an item on the channel; block until the item is accepted.
await ch.put(x)

# Take an item from the channel; block until an item is available.
x = await ch.take()

# Do something each time an item is put on the channel.
async for x in ch:
	do_something(x)
	do_something_else(x)
# Iteration stops when the channel is closed and drained.

Also contains several utilities for piping items between channels, mixing multiple input channels, routing messages by topic, and more.

Project details


Download files

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

Source Distribution

asyncio-channel-0.9.1.tar.gz (12.1 kB view hashes)

Uploaded Source

Built Distribution

asyncio_channel-0.9.1-py2.py3-none-any.whl (18.6 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page