worker_spawn: Spawn a worker

Description Usage Arguments Details

Description

Spawn a worker in the background

Usage

1
2
3
worker_spawn(queue_name, logfile, redis_host = "127.0.0.1",
  redis_port = 6379, n = 1, timeout = 20, time_poll = 1,
  heartbeat_period = NULL, heartbeat_expire = NULL, path = ".")

Arguments

queue_name

Name of the queue to connect to

logfile

Name of a log file to write to (consider tempfile()). If n > 1, then n log files must be provided.

redis_host

Host name/IP for the Redis server

redis_port

Port for the Redis server

n

Number of workers to spawn

timeout

Time to wait for the worker to appear

time_poll

Period to poll for the worker (must be in seconds)

heartbeat_period

Period between heartbeat pulses

heartbeat_expire

Time that heartbeat pulses will persist

path

Path to start the worker in. By default workers will start in the current working directory, but you can start them elsewhere by providing a path here. If the path does not exist, an error will be thrown. If n is greater than 1, all workers will start in the same working directory. The logfile argument will be interpreted relative to current working directory (not the worker working directory); use normalizePath to convert into an absolute path name to prevent this.

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 spawing 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 standalone session.


traitecoevo/rrqueue documentation built on May 31, 2019, 7:44 p.m.