Run a cs9 task in a background R process with live output streaming back to
the current R console via later::later() polling. Equivalent in spirit to
run_task_sequentially_as_rstudio_job_using_load_all() but does not
depend on RStudio's job API (which Positron does not implement).
Methods: $start() spawn background process and begin polling $wait(t) block this session, draining the event loop, until done $is_alive() TRUE while the background process is running $status() summary $tail(n) last n lines of the log file (snapshot, not live) $kill() terminate the background process
Public fields
task_nameCharacter string. Name of the task being run.
ss_prefixCharacter string. R expression used to access the surveillance system in the child process.
script_pathCharacter string. Path to the temporary R script that is sourced in the background process.
log_pathCharacter string. Path to the log file where background process output is written.
started_atPOSIXct. Time at which
$start()was called.finished_atPOSIXct. Time at which the background process exited.
Methods
TaskJob$new()
Create a new TaskJob.
Arguments
task_nameCharacter string. Name of the task to run, as registered in the surveillance system (e.g.
ss$tasks[["my_task"]]).ss_prefixCharacter string. R expression that evaluates to the surveillance system object in the child process. Defaults to
"global$ss".log_dirCharacter string. Directory where the temporary script and log file are written. Defaults to
tempdir().
TaskJob$wait()
Block the current session until the background task finishes or the timeout expires, draining the later event loop while waiting.
