Skip to main content

Module queue

Module queue 

Source

Structs§

InMemQueue
In-memory JobQueue for tests, examples and single-process hosts. Times come from the injected clock, so tests move leases forward with a FixedClock.
Lease
A claimed job: the run to step, the lease token that proves the claim and how many times the job was claimed since it last completed or was rescheduled. A token from an expired, re-claimed lease is stale.

Enums§

JobState
Where one run’s job stands. Pending waits for due_ms; Leased is held until until_ms, with next_due_ms from an enqueue during the lease; Done and Failed end it until the next enqueue.

Traits§

JobQueue
Jobs keyed by run, at most one live job per run. claim_due leases due jobs and expired leases, earliest first; complete, fail and reschedule end a lease and return CoreError::Conflict for a stale one.