Returns the launcher that mizu_channel(), mizu_pool() and
mizu_spawn_workers() use unless given a custom one. It spawns a
detached child R process through a static Rscript runner, with the
entry expression and the .libPaths() of the host hex-encoded in argv.
Arguments
- stdout, stderr
forwarded to
system2(). The default""sends the child output (for a channel peer, including its error epilogue) to the console of the host,FALSEdiscards it, and a file name collects it in that file.On Windows, the child holds a redirection file exclusively for its lifetime, so other processes cannot read it while the child runs, and a second spawn with the same file fails to launch (in a pool, as a startup timeout). A custom launcher that sets the file name from
slotgives one log file per worker (see examples).
Value
A function(token, slot). mizu_pool() and
mizu_spawn_workers() call it with both arguments to spawn the worker
for slot. mizu_channel() calls it with token alone to spawn the
peer.
Containers
system2(wait = FALSE) detaches background children, so workers and peers
are adopted by PID 1 of the process namespace and reaped by that init when
they exit. In a container whose PID 1 does not reap (a plain docker run
without --init), exited children accumulate as zombie PID-table entries.
This is harmless to mizu itself, which detects death through the liveness
lock rather than the PID, but PID-probe supervision misreads zombies as
alive, and mizu_prune() cannot reclaim a dead process's regions while its
PID stays taken.