job spawn for experimental
Spawn a background job and retrieve its ID.
Signature
> job spawn {flags} (closure)
Flags
--tag, -t {string}: An optional description tag for this job
Parameters
closure: The closure to run in another thread.
Input/output types:
| input | output |
|---|---|
| nothing | int |
Examples
Spawn a background job to do some time consuming work
> job spawn { sleep 5sec; rm evidence.pdf }Notes
Executes the provided closure in a background thread and registers this task in the background job table, which can be retrieved with job list.
This command returns the job id of the newly created job.