Skip to main content

Module jobs

Module jobs 

Source
Expand description

What runs in the background, in one place (from lumen’s job registry): each job has a kind (histology, model, export…), a name saying what it is doing, how far it is, and a cancel flag. Only one job that drives the GPU runs at a time (a second is refused, saying what runs). The status bar lists them with a cancel button each; the work itself (off the UI thread) updates its job through its JobHandle, which ends the job when dropped (finished, failed or cancelled alike).

A job can leave an outcome (JobHandle::finish: what it found, or why it failed), kept for a while after it ends. A command that starts a job returns job_reply ({"job": id}), so whoever ran it (an agent through the MCP host) can wait for the job (is_running) and read its outcome.

Structs§

Job
A job running.
JobHandle
A running job, held by the work doing it.

Functions§

cancel
Asks every job of kind to stop (when its work next checks).
cancel_id
Asks the job id to stop.
generation
A number that changes whenever a job starts, moves or ends (the status bar redraws then).
is_running
Whether the job id is still running.
job_of
The job a command’s result names ({"job": id, …}), if any.
job_reply
What a command that started job id returns: {"job": id}.
of
The latest job of kind.
outcome
The outcome the job id left, once it ended (None: running, or it left none and has been forgotten).
running
The jobs running, oldest first.
start
Starts a job; refused while another GPU job runs (when this one is one too).