startLocalWorkers: startLocalWorkers

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

View source: R/redisWorker.R

Description

Start background R worker processes on the local system.

Usage

1
2
3
4
5
startLocalWorkers(n, queue, host = "localhost",
                  port = 6379, iter = Inf,
                  timeout = 30, log = stdout(),
                  Rbin = paste(R.home(component="bin"),"R",sep="/"),
                  password=NULL)

Arguments

n

The number of workers to start.

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 stderr()).

Rbin

The full path to the command-line R program.

password

The Redis server password.

Details

Use startLocalWorkers to start one or more doRedis R worker processes in the background. The worker processes are started on the local system using the redisWorker function.

Running workers self-terminate when their work queues are deleted with the removeQueue function.

Value

Nothing is returned. Set the log parameter to stdout() to see log messages printed on standard output of the invoking R session.

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 redisWorker

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
require('doRedis')
registerDoRedis('jobs')
startLocalWorkers(n=2, queue='jobs')
print(getDoParWorkers())
foreach(j=1:10,.combine=sum,.multicombine=TRUE) %dopar%
          4*sum((runif(1000000)^2 + runif(1000000)^2)<1)/10000000
removeQueue('jobs')

## End(Not run)

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