How-to guides#

After the Quickstart, use these guides in order:

  1. Define and enqueue — define and enqueue work.

  2. Run workers and Results — run and observe it.

  3. Choose backends and Task events — choose production persistence, execution, and delivery options.

Define and control tasks#

Define and enqueue

Register task functions and enqueue them through QueueService.

Define and enqueue
Configure task options

Set retries, timeouts, priority, delay, metadata, and deduplication keys.

Task options
Inspect results

Refresh records, wait for terminal state, and inspect results or errors.

Results
Background responses

Choose whether enqueueing happens before or after the response starts.

Background responses
Failures and cancellation

Control retries and cooperative cancellation.

Failures and cancellation
Schedules

Register interval and cron tasks.

Schedules

Run and operate workers#

Run workers

Choose placement, tune concurrency, pick up work faster, and recover work whose worker died.

Run workers
Run maintenance

Schedule bounded repair and retention with litestar queues run-maintenance.

Queue maintenance
Observe queues

Add traces, metrics, logs, and operational status checks.

Observability

Choose production options#

Choose backends

Choose task storage, execution placement, and worker wakeups separately.

Choose backends
Publish task events

Publish progress and connect live SSE or WebSocket consumers.

Task events
Deploy Cloud Run execution

Persist, dispatch, and execute work across Cloud Run services and Jobs.

Cloud Run Deployment
Deploy on Cloud Tasks

Run queued work with nothing left running between deliveries.

Cloud Tasks Deployment
Dispatch through RabbitMQ

Route task identifiers through a RabbitMQ 4.3 quorum queue.

RabbitMQ dispatch
Dispatch through Kafka

Route task identifiers through a manual-commit Kafka consumer group.

Kafka Dispatch
Dispatch through Pub/Sub

Route task identifiers through a Google Cloud pull subscription.

Google Cloud Pub/Sub dispatch