launch_local {mirai} | R Documentation |
Launch Daemon
Description
launch_local
spawns a new background Rscript
process calling
daemon
with the specified arguments.
launch_remote
returns the shell command for deploying daemons as a
character vector. If a configuration generated by
remote_config
or ssh_config
is supplied then
this is used to launch the daemon on the remote machine.
Usage
launch_local(url, ..., tls = NULL, .compute = "default")
launch_remote(
url,
remote = remote_config(),
...,
tls = NULL,
.compute = "default"
)
Arguments
url |
the character host URL or vector of host URLs, including the port to connect to (and optionally for websockets, a path), e.g. tcp://hostname:5555' or 'ws://10.75.32.70:5555/path' or integer index value, or vector of index values, of the dispatcher URLs, or 1L for the host URL (when not using dispatcher). or for |
... |
(optional) additional arguments passed through to
|
tls |
[default NULL] required for secure TLS connections over tls+tcp or
wss. Zero-configuration TLS certificates generated by |
.compute |
[default 'default'] character value for the compute profile to use (each compute profile has its own independent set of daemons). |
remote |
required only for launching remote daemons, a configuration
generated by |
Details
These functions may be used to re-launch daemons that have exited after reaching time or task limits.
If daemons have been set, the generated command will automatically contain the argument ‘rs’ specifying the length 7 L'Ecuyer-CMRG random seed supplied to the daemon. The values will be different each time the function is called.
Value
For launch_local: Invisible NULL.
For launch_remote: A character vector of daemon launch commands, classed as ‘miraiLaunchCmd’. The printed output may be directly copy / pasted to the remote machine.
Examples
if (interactive()) {
# Only run examples in interactive R sessions
daemons(url = host_url(ws = TRUE), dispatcher = FALSE)
status()
launch_local(status()$daemons, maxtasks = 10L)
launch_remote(1L, maxtasks = 10L)
Sys.sleep(1)
status()
daemons(0)
daemons(n = 2L, url = host_url(tls = TRUE))
status()
launch_local(1:2, idletime = 60000L, timerstart = 1L)
launch_remote(1:2, idletime = 60000L, timerstart = 1L)
Sys.sleep(1)
status()
daemons(0)
}