jobAdd {rstudioapi} | R Documentation |
Add a Job
Description
Inform RStudio's Background Jobs pane that a job has been added.
Usage
jobAdd(
name,
status = "",
progressUnits = 0L,
actions = NULL,
running = FALSE,
autoRemove = TRUE,
show = TRUE
)
Arguments
name |
The background job's name. |
status |
The initial status text for the job; optional. |
progressUnits |
The integer number of units of work in the job; for
example, |
actions |
A list of actions that can be performed on the job (see Actions). |
running |
Whether the job is currently running. |
autoRemove |
Whether to remove the job from the Background Jobs pane when it's complete. |
show |
Whether to show the job in the Jobs pane. |
Value
An ID representing the newly added job, used as a handle to provide further updates of the job's status.
Actions
The actions
parameter is a named list of functions that the user can
invoke on the job; for example: actions = list(stop = function(id) {
... })
. The function will be passed a parameter named id
with the
job ID that invoked it.
There are three special action names:
- stop
If there is an action named
stop
, then the job will have a Stop button in in the Jobs pane, and pressing that button will invoke thestop
action.- info
If there is an action named
info
, then the job will have an informational link in the Background Jobs pane rather than an output display, and clicking the link will invoke theinfo
action.- replay
If there is an action named
replay
, then the job will have a Replay button that displays when the job has finished running. Clicking the button will invoke thereplay
action.
See Also
Other jobs:
jobAddOutput()
,
jobAddProgress()
,
jobGetState()
,
jobList()
,
jobRemove()
,
jobRunScript()
,
jobSetProgress()
,
jobSetState()
,
jobSetStatus()