% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/daemons.R
\name{with.miraiDaemons}
\alias{with.miraiDaemons}
\title{With Mirai Daemons}
\usage{
\method{with}{miraiDaemons}(data, expr, ...)
}
\arguments{
\item{data}{a call to \code{\link{daemons}}.}

\item{expr}{an expression to evaluate.}

\item{...}{not used.}
}
\value{
The return value of \sQuote{expr}.
}
\description{
Evaluate an expression with daemons that last for the duration of the
expression.
}
\details{
This function is an S3 method for the generic \code{with} for class
'miraiDaemons'.
}
\examples{
if (interactive()) {
# Only run examples in interactive R sessions

with(
  daemons(2),
  {
    m1 <- mirai(Sys.getpid())
    m2 <- mirai(Sys.getpid())
    cat(call_mirai(m1)$data, call_mirai(m2)$data, "\n")
  }
)

status()

}

}
