Skip to main content

Docs PyPI Downloads Release Coverage

streaQ

Fast, async, fully-typed distributed task queue via Redis streams

Features

  • Up to 5x faster than arq
  • Fully typed
  • Comprehensive documentation
  • Support for delayed/scheduled tasks
  • Cron jobs
  • Task middleware
  • Task dependency graph
  • 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 both asyncio and trio

[!TIP] Sick of redis-py? Check out coredis, a fast, fully-typed Redis client that supports Trio!

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), dependencies=set(), dependents=set())
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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

streaq-7.1.0.tar.gz (36.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streaq-7.1.0-py3-none-any.whl (44.1 kB view details)

Uploaded Python 3

File details

Details for the file streaq-7.1.0.tar.gz.

File metadata

  • Download URL: streaq-7.1.0.tar.gz
  • Upload date:
  • Size: 36.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for streaq-7.1.0.tar.gz
Algorithm Hash digest
SHA256 876d18b40da46e29fe49ab06b05b31ac93f415b74431401be9c3cec7b524f22b
MD5 69ec5d0fb61186285bb1101d3c54d65a
BLAKE2b-256 c23b50c1457f6a152a1a574a2d4bbbb8777599e47e543753b13516522e63c54a

See more details on using hashes here.

File details

Details for the file streaq-7.1.0-py3-none-any.whl.

File metadata

  • Download URL: streaq-7.1.0-py3-none-any.whl
  • Upload date:
  • Size: 44.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for streaq-7.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f9840253fe1e403ad14a8854971ef894f20222288ae6779a0df0e58b5c5c7a83
MD5 241d991e37abef8b02b012d6559b2fa0
BLAKE2b-256 528597eb7fa34e6fed7aea293080b6d0c6206e07f69ecec89d6f63d754c577af

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

7.1.0 This release

2 files

7.0.0

2 files

6.5.2

2 files

6.5.1

2 files

6.5.0

2 files

6.4.0

2 files

6.3.4

2 files

6.3.3

2 files

6.3.2

2 files

6.3.1

2 files

6.3.0

2 files

6.2.1

2 files

6.2.0

2 files

6.1.0

2 files

6.0.2

2 files

6.0.1

2 files

5.2.2

2 files

5.2.1

2 files

5.2.0

2 files

5.1.0

2 files

5.0.1

2 files

5.0.0

2 files

4.1.1

2 files

4.1.0

2 files

4.0.4

2 files

4.0.3

2 files

4.0.2

2 files

4.0.1

2 files

4.0.0

2 files

3.0.0

2 files

2.2.2

2 files

2.2.1

2 files

2.2.0

2 files

2.1.1

2 files

2.1.0

2 files

2.0.1

2 files

2.0.0

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.0

2 files

0.7.0

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page