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:

{"task_id": "...", "status": "pending"}

By default, QueueConfig() starts a dedicated worker process alongside the server and uses an ephemeral SQLite database. The database is removed on normal shutdown and does not persist across restarts.

Production boundary

The default setup uses a temporary SQLite database and a local worker to get started quickly.

In production, decouple task storage from execution:

  • Storage: Use Redis, Valkey, SQLSpec, or Advanced Alchemy so tasks persist across deploys and restarts.
  • Workers: Run standalone worker processes or Cloud Run jobs so background work scales independently from web requests.

Next steps

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

Metadata

Release files for litestar-queues 0.13.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.13.0
File Size Uploaded Provenance Actions
litestar_queues-0.13.0.tar.gz 1.3 MB With provenance Details for litestar_queues-0.13.0.tar.gz

Built distribution (wheel)

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

Total release size: 1.8 MB

Release files / litestar_queues-0.13.0.tar.gz

Download URL litestar_queues-0.13.0.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
6d4ca98cb572f8a3a0f593ff2448fd1ca2a8f3b5af53d0d12f775793cd66a96f
BLAKE2b-256 checksum
How to use checksums
d86a1f79c975ba57a6c64c032e5016b2b68762bab8393ff7cd68b8b30f966637
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 Nov 3, 2026.

Transparency log

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

Download URL litestar_queues-0.13.0-py3-none-any.whl
Size 411.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
349c64f5f68c1363fd1e796dd4944f5f12f046447e30293cacf6c5ab52ab9a00
BLAKE2b-256 checksum
How to use checksums
6f94d4d2ba25d4e9215c714a7a1e28d2fcbefc53105355610b1dedaec6fc5b2b
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 Nov 3, 2026.

Transparency log

Security for litestar-queues 0.13.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for litestar_queues-0.13.0.tar.gz

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 Nov 3, 2026.

Transparency log

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.

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