streaQ
Fast, async, fully-typed distributed task queue via Redis streams
Features
- Up to 14x faster than
arq - Fully typed
- Comprehensive documentation
- Support for delayed/scheduled tasks
- Cron jobs
- Task middleware
- Dead-letter queue
- Pipelining
- Priority queues
- Support for synchronous tasks (run in separate threads)
- Redis Sentinel & Cluster support for production
- Built-in web UI for monitoring tasks
- Built with structured concurrency on
anyio, supports bothasyncioandtrio
Installation
$ pip install streaq
Getting started
To start, you'll need to create a Worker object:
from streaq import Worker
worker = Worker(redis_url="redis://localhost:6379", anyio_backend="trio")
You can then register async tasks with the worker like this:
import trio
@worker.task
async def sleeper(time: int) -> int:
await trio.sleep(time)
return time
@worker.cron("* * * * mon-fri") # every minute on weekdays
async def cronjob() -> None:
print("Nobody respects the spammish repetition!")
Finally, let's use the worker's async context manager to queue up some tasks:
async with worker:
await sleeper.enqueue(3)
# enqueue returns a task object that can be used to get results/info
task = await sleeper.enqueue(1).start(delay=3)
print(await task.info())
print(await task.result(timeout=5))
Putting this all together gives us example.py. Let's spin up a worker:
$ streaq run example:worker
and queue up some tasks like so:
$ python example.py
Let's see what the output looks like:
[INFO] 2025-09-23 02:14:30: starting worker 3265311d for 2 functions
[INFO] 2025-09-23 02:14:35: task sleeper □ cf0c55387a214320bd23e8987283a562 → worker 3265311d
[INFO] 2025-09-23 02:14:38: task sleeper ■ cf0c55387a214320bd23e8987283a562 ← 3
[INFO] 2025-09-23 02:14:40: task sleeper □ 1de3f192ee4a40d4884ebf303874681c → worker 3265311d
[INFO] 2025-09-23 02:14:41: task sleeper ■ 1de3f192ee4a40d4884ebf303874681c ← 1
[INFO] 2025-09-23 02:15:00: task cronjob □ 2a4b864e5ecd4fc99979a92f5db3a6e0 → worker 3265311d
Nobody respects the spammish repetition!
[INFO] 2025-09-23 02:15:00: task cronjob ■ 2a4b864e5ecd4fc99979a92f5db3a6e0 ← None
TaskInfo(fn_name='sleeper', enqueue_time=1751508876961, tries=0, scheduled=datetime.datetime(2025, 7, 3, 2, 14, 39, 961000, tzinfo=datetime.timezone.utc), child=None)
TaskResult(fn_name='sleeper', enqueue_time=1751508876961, success=True, start_time=1751508880500, finish_time=1751508881503, tries=1, worker_id='ca5bd9eb', _result=1)
For more examples, check out the documentation.
Metadata
Release files for streaq 8.0.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 | Provenance | Actions |
|---|---|---|---|---|
| streaq-8.0.0.tar.gz | 40.5 kB | Without provenance | Details for streaq-8.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| streaq-8.0.0-py3-none-any.whl | Python 3 | none | any | Details for streaq-8.0.0-py3-none-any.whl |
Total release size: 88.5 kB
Release files / streaq-8.0.0.tar.gz
| Download URL | streaq-8.0.0.tar.gz |
|---|---|
| Size | 40.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2c69b0e56263adf2b39f8e44d9ae92f2ddff352b6a1742b919232763c7351b7e
|
|
BLAKE2b-256 checksum How to use checksums |
b85c8b5222a9868724b79167b610b67a41b5f527df1e2c6e8a04eae405f4fa5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / streaq-8.0.0-py3-none-any.whl
| Download URL | streaq-8.0.0-py3-none-any.whl |
|---|---|
| Size | 48.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
44780a41278c38025b6a7fd1a69c5180cc409c999436e339e569872cf8839014
|
|
BLAKE2b-256 checksum How to use checksums |
df3e49cae560a96c95a5d2afc53912327a1a4fe458058654ec34f98937f7f9ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for streaq 8.0.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.