Skip to main content

Module jobs

Module jobs 

Source
Expand description

Jobs: discrete non-conversational units of work (image generation and other generators) with progress and a persisted terminal result. This module holds the pure data model, the seed injection, and the terminal-job history store; the async scheduler that drives runners lives in the runtime crate.

Structs§

Job
A discrete unit of work with progress and a persisted terminal result. Its on-disk form (in jobs.json) is internal, so field names are the native snake_case.
JobHistoryStore
A bounded, newest-first store of concluded jobs. Lazily loaded; a corrupt jobs.json is quarantined and the store starts empty rather than failing.
JobProgress
A job’s progress: a [0, 1] fraction plus the raw step counts it came from.

Enums§

JobEvent
What the scheduler publishes to events(id) observers. Coarser than the runtime stream: it collapses the runner’s ticks into the observable state.
JobRuntimeEvent
One item a job runtime (image generation) streams back. The sidecar job pump emits Started/Progress/Preview/Result; Status and Artifacts are added by the scheduler layer that wraps the pump.
JobState
A job’s lifecycle state.

Functions§

reseeded
Re-seed params with a fresh seed guaranteed to differ from its current one (used by “vary”). A non-object payload is returned unchanged.
seeded
Inject a random seed into payload when it is a JSON object (or null, treated as empty) that carries no non-null seed. Anything else, and any object that already pins a seed, is returned unchanged.