pub struct TaskQuota {
pub max_queued: Option<usize>,
pub max_in_flight: Option<usize>,
pub max_dlq: Option<usize>,
}Expand description
Tenant quota for the durable task queue (R0.6 wave 3): three gauges,
each capped independently — tasks queued, tasks in flight, dead-letter
depth — enforced at submission (POST /tasks, POST /tasks/outbox,
and update_state’s atomic enqueue list). Over quota answers 429 quota_exceeded, the honest shape for “retry this submission later”.
The gauges are the store’s TaskUsage definitions: the backlog
counts scheduled retries and outbox rows pending publication (a flood
through the outbox must not bypass the quota), in flight counts every
leased record, and the DLQ counts because an unbounded dead-letter
queue is a quiet disk-full outage. None (the default for every field)
means unlimited, preserving pre-wave-3 behavior.
Fields§
§max_queued: Option<usize>Cap on the tenant’s backlog (queued + retry-scheduled + pending outbox rows). A submission that would push the backlog past the cap is rejected.
max_in_flight: Option<usize>Cap on tasks in flight (status leased). Pure backpressure: a
tenant already at the cap has its new submissions rejected until
workers settle.
max_dlq: Option<usize>Cap on dead-letter depth. A tenant at the cap must inspect and re-drive its DLQ before more work is accepted.