Capy-Bearer Documentation

job_result

host call

Capy

function job_result(job : dval) dval

Description

job_result() checks a job with a short bounded wait. Use it to poll a job after shell_exec(command, flags) or http_request_async().

Parameters

job : a job ID as dval

Return Values

A job status map. A completed job includes result.

Example

Capy

var job := shell_exec("printf result", {background: true, timeout_ms: 1000})
job_await(job, 3000)
print(get_by_path(job_result(job), "result/stdout"), "\n")