Skip to content

.jobs.spawn ​

Liatir.jobs.spawn() starts an async native process and returns immediately with a job ID.

Signature ​

SpawnOptions ​

Example ​

Return value ​

FieldTypeDescription
jobIdstring / strUnique identifier for the job.

IMPORTANT

Return value fields are always camelCase in Node, Python, R and Native, because they come from the JSON response of the Liatir bridge.

Wait for completion and read output ​

run starts a Job and waits for a terminal state while delivering stdout/stderr lines to callbacks. A terminal state can be failure or cancellation: inspect status.type and status.exitCode before returning a successful Plugin result.

R run(cmd, args = list(), cwd = NULL, on_stdout = NULL, on_stderr = NULL) returns a terminal Job as a named list. Native Rust run(cmd, args, options, on_stdout, on_stderr) returns a JSON Job value. The callbacks receive individual lines. Use spawn when you need to return immediately or pass R environment/label/metadata options.

get_output(job_id, since = NULL) in R and get_output(job_id, since: Option<usize>) in Rust return buffered stdout and stderr arrays plus stdoutTotal and stderrTotal. The existing Node and Python names are getOutput and get_output, respectively.

For Native Rust's Result<Value> convention and imports, see the bridge reference. Development child Jobs are associated with their session and workspace.