Current.JobSourceJobs with log files. This is mostly an internal interface - use Current_cache instead.
val create :
?priority:Pool.priority ->
switch:Switch.t ->
label:string ->
config:Config.t ->
unit ->
tcreate ~switch ~label ~config () is a new job.
start t ~level marks t as running. This can only be called once per job. If confirmation has been configured for level, then this will wait for confirmation first.
start_with is like start except that it waits for a resource from pool. The resource is freed when the job finishes.
start_time t is the time when start was called, or an unresolved promise for it if start hasn't been called yet.
log t fmt appends a formatted message to the log, with a newline added at the end.
log_path id is the path of the log for job id, if valid.
wait_for_log_data t is a promise that resolves the next time log data is written or the log is closed.
If lookup_running job_id is the job j with id job_id, if is_running j.
jobs () is the set of active jobs, whether they are currently used in a pipeline or not. This is any job which is running or ready to run (i.e. every job which hasn't closed its log file).
approve_early_start t marks the job as approved to start even if the global confirmation threshold would otherwise prevent it. Calling this more than once has no effect.
Indicates whether the job would benefit from approve_early_start being called.
on_cancel t fn calls fn reason if the job is cancelled. If the job has already been cancelled, fn is called immediately. If a job finishes without being cancelled, the cancel hooks are run at the end anyway.
with_handler t ~on_cancel fn is like fn (), but if the job is cancelled while fn is running then on_cancel reason is called. Even if cancelled, fn is still run to completion. If the job has already been cancelled then on_cancel reason is called immediately (but fn still runs).
cancel msg requests that t be cancelled. This runs all registered cancel hooks and marks the job as cancelled. If the job is already cancelled, this has no effect.
cancelled_state t is Ok () if the job hasn't been cancelled, or Error (`Msg reason) if it has. This should not be used after the switch has been turned off.
register_actions job_id actions is used to register handlers for e.g. rebuilding jobs.