3.3 KiB
title | description | layout | menu | ||||
---|---|---|---|---|---|---|---|
Module hilbish.jobs | background job management | doc |
|
Introduction
Manage interactive jobs in Hilbish via Lua.
Jobs are the name of background tasks/commands. A job can be started via interactive usage or with the functions defined below for use in external runners.
Functions
add(cmdstr, args, execPath) | Adds a new job to the job table. Note that this does not immediately run it. |
all() -> table<@Job> | Returns a table of all job objects. |
disown(id) | Disowns a job. This deletes it from the job table. |
get(id) -> @Job | Get a job object via its ID. |
last() -> @Job | Returns the last added job from the table. |
hilbish.jobs.add(cmdstr, args, execPath)
Adds a new job to the job table. Note that this does not immediately run it.
Parameters
This function has no parameters.
hilbish.jobs.all() -> table\<Job>
Returns a table of all job objects.
Parameters
This function has no parameters.
hilbish.jobs.disown(id)
Disowns a job. This deletes it from the job table.
Parameters
This function has no parameters.
hilbish.jobs.get(id) -> Job
Get a job object via its ID.
Parameters
This function has no parameters.
hilbish.jobs.last() -> Job
Returns the last added job from the table.
Parameters
This function has no parameters.
Methods
background()
Puts a job in the background. This acts the same as initially running a job.
foreground()
Puts a job in the foreground. This will cause it to run like it was executed normally and wait for it to complete.
start()
Starts running the job.
stop()
Stops the job from running.