Skip to main content

Litestar Queues

PyPI Python License CI Docs

Litestar Queues lets a Litestar application persist work, run it in a worker, and inspect the result. Use it for work that should outlive the request that started it: sending email, importing files, refreshing reports, or calling a slow service.

Quickstart

Install the package:

pip install litestar-queues

Create app.py:

from litestar import Litestar, post
from litestar.di import NamedDependency

from litestar_queues import QueueConfig, QueuePlugin, QueueService, task


@task("accounts.sync", queue="accounts", timeout=30)
async def sync_account(account_id: str) -> dict[str, str]:
    return {"account_id": account_id, "status": "synced"}


@post("/accounts/{account_id:str}/sync")
async def create_sync_job(
    account_id: str,
    queue_service: NamedDependency[QueueService],
) -> dict[str, str]:
    result = await queue_service.enqueue(sync_account, account_id)
    return {"task_id": str(result.id), "status": result.status or "pending"}


app = Litestar(
    route_handlers=[create_sync_job],
    plugins=[QueuePlugin(config=QueueConfig())],
)

Run the application:

LITESTAR_APP=app:app litestar run --reload

Enqueue a task:

curl -X POST http://127.0.0.1:8000/accounts/acct-123/sync

The response contains a task ID and an initial status. QueueConfig() starts one fresh queue-worker child for this litestar run invocation and shares a private temporary SQLite file with it. No queue socket or port is exposed, and the temporary queue is removed on normal shutdown; it is not durable across server restarts.

Production boundary

Choose where tasks are stored separately from where they run. For durable deployments use a shared backend such as SQLSpec, Advanced Alchemy, Redis, or Valkey. Use standalone workers when the web app and task workers must scale separately. The process-local memory backend remains useful for inline tests or an explicitly single-ASGI-process worker. Cloud Run runs tasks; it does not store them.

Next steps

Litestar Queues supports Python 3.10 through 3.14 and is licensed under MIT.

Release files for litestar-queues 0.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for litestar-queues 0.10.0
File Size Uploaded
litestar_queues-0.10.0.tar.gz 1.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for litestar-queues 0.10.0
File Interpreter ABI Platform
litestar_queues-0.10.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.5 MB

Release files / litestar_queues-0.10.0.tar.gz

Download URL litestar_queues-0.10.0.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
c5584603eaad9862568205d9f55167d5e39736775afa0d0e20c255bdac9ebc87
BLAKE2b-256 checksum
How to use checksums
4668a64aa798197b87a7521faa00ae48c456e9956e6eaa440bff15bf95423010
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 30, 2026.

Transparency log

Release files / litestar_queues-0.10.0-py3-none-any.whl

Download URL litestar_queues-0.10.0-py3-none-any.whl
Size 379.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
09eec7652aa7d3fa02bb1b4e2e34a9cb9b80088d46cede8eb8223e420785a7c8
BLAKE2b-256 checksum
How to use checksums
be2a5b361c225e9c4d2b3def2849b4c2be2caf792b74372dfde014dc667a219e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 30, 2026.

Transparency log

Release history Release notifications | RSS feed

0.12.0

2 release files

This release

0.10.0 This release

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page