The redisWorker function enrolls the current R session in one or
more doRedis worker pools specified by the work queue names. The worker
loop takes over the R session until the work queue(s) are deleted, after
which the worker loop exits after the linger
period, or until
the worker has processed iter
tasks.
Running workers also terminate after network activity with Redis remains
inactive for longer than the timeout
period set in the redisConnect
function. That value defaults internally to 30 seconds in redisWorker
.
You can increase it by including a timeout=n argument value.
redisWorker(
queue,
host = "localhost",
port = 6379,
iter = Inf,
linger = 30,
log = stderr(),
connected = FALSE,
password = NULL,
loglevel = 0,
timelimit = 0,
...
)
NULL is invisibly returned.
work queue name or a vector of queue names
Redis database host name or IP address
Redis database port number
maximum number of tasks to process before exiting the worker loop
timeout in seconds after which the work queue is deleted that the worker terminates
print messages to the specified file connection
set to TRUE
to reuse an existing open connection to Redis, otherwise establish a new one
optional Redis database password
set to > 0 to increase verbosity in the log
set to > 0 to specify a task time limit in seconds, after which worker processes are killed; beware that setting this value > 0 will terminate any R worker process if their task takes too long.
Optional additional parameters passed to redisConnect
registerDoRedis
, startLocalWorkers