Spawn a worker in the background

worker_spawn(
  obj,
  n = 1,
  logdir = NULL,
  timeout = 600,
  worker_config = "localhost",
  worker_name_base = NULL,
  time_poll = 1,
  progress = NULL
)

worker_wait(obj, key_alive, timeout = 600, time_poll = 1, progress = NULL)

Arguments

obj

An rrq_controller object

n

Number of workers to spawn

logdir

Path of a log directory to write the worker process log to, interpreted relative to the current working directory

timeout

Time to wait for workers to appear

worker_config

Name of the configuration to use. By default the "localhost" configuration is used

worker_name_base

Optional base to construct the worker names from. If omitted a random name will be used.

time_poll

Polling period (in seconds) while waiting for workers to come up. Must be an integer, at least 1.

progress

Show a progress bar while waiting for workers (when timeout is at least 0)

key_alive

A key name (generated from rrq_expect_worker or worker_spawn)

Details

Spawning multiple workers. If n is greater than one, multiple workers will be spawned. This happens in parallel so it does not take n times longer than spawning a single worker.

Beware that signals like Ctrl-C passed to this R instance can still propagate to the child processes and can result in them dying unexpectedly. It is probably safer to start processes in a completely separate session.