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
Release history Release notifications | RSS feed
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.tar.gz
(12.2 kB
view hashes)
Built Distribution
Close
Hashes for asyncio_channel-0.9-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7dc8e1a769307c935d06f1944d6e1c61fa9924a9b1c36b6a0dd878729868758 |
|
MD5 | 03c547d33b2aafbf8406772efed04253 |
|
BLAKE2b-256 | c9ec30a726edf9477e507931f4d68922865823510cdaa2dd51aa7ced9d2574f9 |