redisWorker: redisWorker

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/redisWorker.R

Description

Initialize a doRedis worker R process.

Usage

1
2
3
4
5
6
7
8
redisWorker(queue,
            host = "localhost",
            port = 6379,
            iter = Inf,
            timeout = 30,
            log = stdout(),
            connected=FALSE,
            password=NULL)

Arguments

queue

A (character) work queue name, or a list or character vector of queue names.

host

The Redis server host name or (character) I. P. address.

port

The Redis server port number.

iter

The maximum number of jobs to execute before exiting the worker loop (defaults to infinity).

timeout

The worker loop terminates if the work queue is deleted after the specified timeout interval.

log

Log messages to the specified destination (defaults to stdout()).

connected

Is the R session creating the worker already connected to Redis?

password

The Redis server password.

Details

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 either the work queue(s) are deleted or the worker times out waiting for a new task.

Value

Nothing is returned but status messages are printed to the log during operation of the worker loop.

Note

All doRedis functions require network access to a Redis server (not included with the doRedis package).

Author(s)

B. W. Lewis <blewis@illposed.net>

See Also

registerDoRedis

Examples

1
2
3
4
5
## Not run: 
require('doRedis')
redisWorker('jobs')

## End(Not run)

cloudcell/doRedis111stable documentation built on May 13, 2019, 8:02 p.m.