aiochannel
asyncio Channels (closable queues) inspired by golang
What it is and what it does
aiochannel implements a channel abstraction for asyncio that mirrors Go's channel semantics. Unlike asyncio.Queue, a channel is considered "done" only when both closed and drained, so calling join() waits for full completion rather than just emptiness. The package provides async put/get methods that block until an item is available or space is free, non-async put_nowait/get_nowait variants, and async iteration support via async for loops. It raises ChannelClosed exceptions when operations occur on closed channels, giving explicit control over task synchronization.
The library has been maintained since 2015 and currently supports Python 3.10 through 3.14 with full type hints. It carries no external runtime dependencies, making it lightweight to add to projects that already use asyncio. The API is intentionally similar to asyncio.Queue to minimize learning curve, but the close-and-drain semantics make it better suited for producer-consumer patterns where you need to signal completion and ensure all work is processed before proceeding.
Use it for:
- Coordinate work between multiple async tasks where you need to signal when production is complete and all items are consumed.
- Implement producer-consumer pipelines in asyncio applications with explicit lifecycle management.
- Replace asyncio.Queue when you need channels to remain closed permanently and distinguish between empty and closed states.
- Build async task pools or worker patterns where tasks communicate through typed, closable message channels.
- Migrate Go-style concurrent code to Python asyncio while preserving channel-based communication patterns.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides asyncio-compatible channels (closable queues) inspired by Go, allowing safe inter-task communication with explicit close and drain semantics.
Yes. The package is actively maintained, has no dependencies, installs cleanly, and fills a real gap in asyncio's toolkit for applications that need Go-like channel semantics. The Apache-2.0 license is permissive. Install it if your asyncio code needs explicit close-and-drain lifecycle control or if you're porting Go patterns to Python.
Install
aiochannel on PyPI
pip
pip install aiochanneluv
uv add aiochannelpoetry
poetry add aiochannelInstalling aiochannel
Before you install
Low friction: pure Python wheel with no runtime dependencies. Actively maintained with a release 27 days ago and commits through August 2026; supports Python 3.10–3.14.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
import asyncio
from aiochannel import Channel
async def main():
ch = Channel(100)
await ch.put("hello")
item = await ch.get()
ch.close()
await ch.join()
asyncio.run(main())
Requires Python 3.10 or later; asyncio event loop must be running.
Verify before relying
- Performance characteristics (throughput, latency) compared to asyncio.Queue under typical workloads.
- Whether the package is used in production systems and what scale of deployments it supports.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<4.0,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 27 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 88,819/month — #13,701 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aiochannel-1.4.1-py3-none-any.whl
Keywords: asyncio, aio, chan, channel, gochan
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
janusProvides a thread-safe queue with both…
permissive · top 5,000 on PyPI
aiormqaiormq is a pure Python AMQP 0.9.1 client…
permissive · top 5,000 on PyPI
culsansProvides a dual-interface queue (sync and…
permissive · top 5,000 on PyPI
taskiq-aio-pikaProvides a RabbitMQ broker implementation for…
permissive · top 15,000 on PyPI
aio-pikaaio-pika is an asyncio-based wrapper around…
permissive · top 5,000 on PyPI
arqarq provides a job queue system for Python that…
permissive · top 5,000 on PyPI
amqpPure-Python AMQP 0.9.1 client library for…
permissive · top 1,000 on PyPI
aioserialProvides async/await serial port I/O using…
copyleft · top 15,000 on PyPI
gcloud-aio-taskqueueAsyncio and threadsafe Python client library…
permissive · top 15,000 on PyPI
channels-redisProvides Redis-backed channel layers for Django…
permissive · top 5,000 on PyPI