status-methods: Check Status of Sleigh Workers

Description Usage Arguments Details Value Examples

Description

Check status of sleigh workers.

Usage

1
2
## S4 method for signature 'sleigh'
status(.Object, closeGroup=FALSE, timeout=0)

Arguments

.Object

a sleigh class object

closeGroup

a logical value indicating whether to close the worker group

timeout

timeout value measure in seconds

Details

The argument closeGroup is set to FALSE by default. If closeGroup is set to FALSE, then all workers must wait for the others to start before they can start working on tasks. If closeGroup is set to TRUE, no new workers may join the group after the timeout value has expired. Once the group is closed, all launched workers can start working on tasks.

The timeout argument indicates how long to wait and check on the status of workers.

Value

a list that contains two values:

numWorkers

the number of workers started

closed

If closed is zero, then some workers failed to start. If closed is one, then either all workers have started or closeGroup is set to TRUE.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
# example 1
# one available machine and one non-existent machine
s <- sleigh(c('localhost', 'noname'))
slist <- status(s)
# slist$numWorkers = the number of worker started
# slist$closed = whether the worker group is closed or not. 

# example 2
# check the status of worker group after 20 seconds
slist <- status(s, timeout=20)

# example 3
# close the group after 10 seconds, regardless of whether
# all workers have started up successfully.
slist <- status(s, closeGroup=TRUE, timeout=10)

## End(Not run)

nws documentation built on May 2, 2019, 8:51 a.m.