with.miraiDaemons: With Mirai Daemons

View source: R/daemons.R

with.miraiDaemonsR Documentation

With Mirai Daemons

Description

Evaluate an expression with daemons that last for the duration of the expression. Ensure each mirai within the statement is explicitly called (or their values collected) so that daemons are not reset before they have all completed.

Usage

## S3 method for class 'miraiDaemons'
with(data, expr, ...)

Arguments

data

a call to daemons().

expr

an expression to evaluate.

...

not used.

Details

This function is an S3 method for the generic with() for class 'miraiDaemons'.

Value

The return value of expr.

Examples


with(
  daemons(2, dispatcher = FALSE),
  {
    m1 <- mirai(Sys.getpid())
    m2 <- mirai(Sys.getpid())
    cat(m1[], m2[], "\n")
  }
)

status()


mirai documentation built on April 4, 2025, 12:27 a.m.