Skip to main content

Module async_jobs

Module async_jobs 

Source
Expand description

Runs asynchronous jobs: claims queued rows from async_jobs, hands each to the JobHandler registered for its kind, keeps the job’s lease renewed while the handler works, and records the result.

Any number of these workers may run at once, on any number of hosts: a claim is one row-locking statement, so no two take the same job, and a worker that dies simply stops renewing, which hands its jobs back to the queue (up to each job’s max_attempts). The same worker also runs the maintenance sweeps: failing jobs abandoned past their last attempt, and removing expired ones, letting their handlers remove what they produced.

Structs§

AsyncJobWorker
AsyncJobWorkerConfig
JobContext
What a running handler sees of its job, and how it talks back: progress for the client’s X-Progress, and whether the client has cancelled.

Enums§

JobOutput
What a finished handler hands back, and how the status endpoint serves it.

Traits§

JobHandler
Runs jobs of one kind.

Type Aliases§

HandlerFuture