Skip to main content

Module progress

Module progress 

Source
Expand description

Where a job is, as far as somebody outside the worker can tell.

A job that takes a minute is a spinner for a minute unless it says how far it has got. The job calls JobContext::progress; a request handler in the web process reads ProgressStore::get; the two share a store and nothing else — which is the point, because the worker is usually another process on another machine.

Progress is a hint. It is written with no transaction and read with no lock, and a job that crashes between two reports leaves the last one standing. The worker closes that gap: it marks the job finished on success and failed on the final attempt, whatever the job last said.

Structs§

JobContext
What a running job is handed: who it is, and where to say how far it has got.
MemoryProgress
Progress kept in this process. Right for tests and for a worker that runs inside the web process; wrong once the worker is a separate process, which is the arrangement this exists for.
Progress
One job’s position.

Traits§

ProgressStore
Where progress lives. Keyed by job id, and by chain id for a job that is a step in one.

Type Aliases§

ProgressFuture