Capy-Bearer Documentation

job_status

host call

Capy

function job_status(job : dval) dval

Description

job_status() checks a job without waiting. The map can include state, done, kind, pid, and job_id.

The state value can be pending, running, done, failed, cancelled, or missing.

Parameters

job : a job ID as dval

Return Values

A job status map.

Example

Capy

var job := shell_exec("printf x", {background: true, timeout_ms: 1000})
job_await(job, 3000)
print(job_status(job)["state"], "\n")