Table of Contents

Class JobCapacitySettings

Namespace
MailFathom.Application.Jobs.Execution
Assembly
MailFathom.Application.dll

Bounds how much of an instance the queue may take: how much runs at once, and how much may be waiting.

public sealed record JobCapacitySettings : IEquatable<JobCapacitySettings>
Inheritance
JobCapacitySettings
Implements
Inherited Members

Remarks

Two bounds that are different in kind, which is why they are stated together rather than derived from each other. Concurrency limits what runs at once, and it is what protects the database connections, the memory, and the processor an MCP read also needs. Queue depth limits what may be waiting, and when it is reached the enqueuer is told rather than served — a queue that silently grows is one that fails later, further from the cause, and with a backlog somebody has to clear by hand.

Both are per job type as well, because one consumer flooding the queue is the ordinary case rather than the exotic one. A single shared ceiling reached by one type would starve every other, so the per-type bound is what keeps a bulk re-evaluation of one kind of work from being the reason another kind never runs.

A per-type concurrency ceiling above the process ceiling is refused rather than clamped. The process ceiling already caps it, so the larger number would state a bound nothing can reach, and a bound that cannot be reached is a bound an operator believes they have.

Properties

MaxConcurrentJobs

Gets how many jobs this process may run at once, across every type together.

MaxConcurrentJobsPerType

Gets how many jobs of one type this process may run at once.

MaxQueueDepthPerType

Gets how many jobs of one type may be waiting before enqueuing expresses backpressure.

Methods

Create(int, int, int)

States the capacity the queue runs under.