skillfed

aiochannel

asyncio Channels (closable queues) inspired by golang

aiochannel v1.4.1 88.8K downloads/30d#13,701 on PyPI41
Permissive license Apache-2.0 Active released

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 aiochannel

uv

uv add aiochannel

poetry

poetry add aiochannel

Installing 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

Development Status :: 5 - Production/StableFramework :: AsyncIOIntended Audience :: DevelopersIntended Audience :: System AdministratorsLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Typing :: Typed

Tags

asyncio channel queueasync communication primitivegolang-style channels pythonclosable async queueasyncio task coordinationasync inter-process messagingtyped async channels
asyncioconcurrency-primitivegolang-inspired

More Application Frameworks packages

Further reading