Configuration#
Pass one QueueConfig to the plugin:
from litestar_queues import QueueConfig, QueuePlugin, WorkerConfig
queue_plugin = QueuePlugin(
config=QueueConfig(
queue_backend="memory",
execution_backend="local",
worker=WorkerConfig(placement="asgi"),
)
)
Use this page as a map; each linked guide owns the detailed behavior.
Concern |
Settings |
Guide |
|---|---|---|
Persistence |
|
|
Runtime identity |
|
|
Execution placement |
|
|
Worker placement |
|
|
Claiming and concurrency |
|
|
Idle waiting |
|
|
Heartbeats and recovery |
|
|
Queued task expiration |
|
|
Shutdown |
|
|
Task discovery |
|
|
Argument identity size guard |
|
|
Schedules |
|
|
Bounded maintenance |
|
|
Events |
|
|
Observability |
|
|
External dependencies |
|
External dependencies#
QueueConfig.task_dependency_resolver and QueueConfig.task_dependency_provider allow injecting external resources into queued tasks. You may configure at most one of these hooks; configuring both raises a QueueConfigurationError. See Task Dependencies for details.
Adaptive polling#
Polling-only workers reduce idle backend traffic by increasing their wait
after empty cycles. The default grows from 0.1 seconds to at most 30
seconds, applies bounded jitter, and resets immediately when work or a native
notification arrives:
worker = WorkerConfig(
poll_interval=0.1,
poll_backoff_max=10.0,
poll_backoff_multiplier=2.0,
poll_jitter=0.15,
)
For polling-only backends, poll_backoff_max is the worst-case discovery
latency for newly inserted work. Native notifications still wake immediately,
and known scheduled or retry work clamps the wait to its due time. Set
poll_backoff_max=None to retain fixed-interval polling when latency matters
more than idle load.
Validation requires poll_interval > 0,
poll_backoff_max >= poll_interval when a maximum is set,
poll_backoff_multiplier >= 1.0, and 0.0 <= poll_jitter <= 1.0. The
stored interval resets to poll_interval on startup, claimed work, a native
notification, and recoverable backend or listener errors.
Defaults favor zero-configuration background execution: ephemeral SQLite,
local execution, and one server-owned worker started by litestar run.
Choose persistent storage and placement explicitly for durable deployments.
Runtime namespace#
namespace renames every runtime name the package owns — loggers, metrics,
channels, keys, and generated routes — from a single setting. Most applications
leave it alone; see Runtime namespace when you need to change it.