Python background queues with an async twist
Use async functions to manage complex background task workflows, and keep using synchronous functions for everything else.
Getting Started
Install queueio:
pip install queueio
Create your routines:
# basic.py
from time import sleep
from queueio import gather
from queueio import pause
from queueio import routine
@routine(name="blocking", queue="basic")
def blocking():
sleep(0.1) # Regular blocking call
@routine(name="yielding", queue="basic")
async def yielding(iterations: int):
# Do them two at a time
for _ in range(iterations // 2):
await gather(blocking(), blocking())
await pause(0.2) # Release processing capacity
if iterations % 2 == 1:
await blocking()
Add the configuration to your pyproject.toml:
[tool.queueio]
# Configure the broker (currently supports amqp:// URIs)
broker = "amqp://guest:guest@localhost:5672/"
# Register the modules that the worker should load to find your routines
register = ["basic"]
The broker configuration can be overridden with an environment variable to allow a project to be deployed in multiple environments.
QUEUEIO_BROKER='amqp://guest:guest@localhost:5672/'
Sync the queues to the broker:
queueio sync
Submit the routine to run on a worker:
from queueio import activate
from basic import yielding
with activate():
yielding(7).submit()
Then run the worker to process submitted routines:
queueio run basic=4
Monitor the status of active routine invocations:
queueio monitor
Stability
The design of the public API is under active development and is likely to change with any release. Release notes will provide upgrade instructions, but backward compatibility and deprecation warnings will not generally be implemented.
Release files for queueio 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| queueio-0.7.0.tar.gz | 55.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| queueio-0.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 129.3 kB
Release files / queueio-0.7.0.tar.gz
| Download URL | queueio-0.7.0.tar.gz |
|---|---|
| Size | 55.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6987ad47b6fb6ec36f9a0382a6ed544f717ddfb5f0dd27791f2749d72e26ba23
|
|
BLAKE2b-256 checksum How to use checksums |
654bb9487a5e32494b6695574fdf0350deb8b9be659e5aea966c216e81aed839
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 10, 2026.
Transparency logRelease files / queueio-0.7.0-py3-none-any.whl
| Download URL | queueio-0.7.0-py3-none-any.whl |
|---|---|
| Size | 73.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
51616074bc145de8166d006c8820e9d270347054f728d31d95949d51249aecf7
|
|
BLAKE2b-256 checksum How to use checksums |
885461a6feaf8742057650c7fc1f8fe1d84c6bfe27a2ea203375a26ecc990612
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 10, 2026.
Transparency log