Interface IJobQueueDepthReader
- Namespace
- MailFathom.Application.Jobs.Execution
- Assembly
- MailFathom.Application.dll
Measures how much work of each type is waiting to be claimed.
public interface IJobQueueDepthReader
Remarks
Waiting is the pending state alone, which is the same reading the enqueue bound is applied against: a job a worker holds is running, and what bounds that is the concurrency ceiling rather than the queue's depth. Counting a running job here would make an instance draining its queue look like one filling it, and would make the depth an operator watches disagree with the depth an enqueue is refused at.
The count saturates at the configured depth bound rather than reporting a true total, so the cost of asking stays the same on a queue of a thousand and on a queue of a million. A reading sitting at the bound is the reading that matters anyway: it is the point at which enqueuing is already being refused as backpressure.
Methods
- ReadWaitingDepthsAsync(IReadOnlyList<JobType>, CancellationToken)
Measures what is waiting for each of the types named.