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()spawns the background process and starts to poll its output.$wait(t)blocks this session until the task finishes. It drains the event loop while it waits.$is_alive()returns TRUE while the background process runs.$status()prints a brief status summary.$tail(n)prints the last n lines of the log file (a snapshot, not live).$kill()terminates 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. This method drains the later event loop while it waits.
