nextstream: Next >> Developer Interface

View source: R/next.R

nextstreamR Documentation

Next >> Developer Interface

Description

nextstream retrieves the currently stored L'Ecuyer-CMRG RNG stream for the specified compute profile and advances it to the next stream.

nextget retrieves the specified item from the specified compute profile.

Usage

nextstream(.compute = "default")

nextget(x, .compute = "default")

Arguments

.compute

[default 'default'] character compute profile (each compute profile has its own set of daemons for connecting to different resources).

x

character value of item to retrieve. One of 'pid' (dispatcher process ID), 'urls' (URLs dispatcher is listening at) or 'tls' (the stored client TLS configuration to be sent to daemons).

Details

These functions are exported for use by packages extending mirai with alternative launchers of daemon processes.

For nextstream: This function should be called for its return value when required. The function also has the side effect of automatically advancing the stream stored within the compute profile. This ensures that next time the function is called the correct value will be returned.

Value

For nextstream: a length 7 integer vector, as given by .Random.seed when the L'Ecuyer-CMRG RNG is in use (may be passed directly to the 'rs' argument of daemon), or else NULL if a stream has not yet been created.

For nextget: the requested item, or else NULL if not present.

Examples

if (interactive()) {
# Only run examples in interactive R sessions

daemons(1L)
nextstream()
nextstream()

nextget("pid")
nextget("urls")

daemons(0)

}


mirai documentation built on Nov. 16, 2023, 5:08 p.m.