| crew_class_launcher | R Documentation |
R6 abstract class to build other subclasses
which launch and manage workers.
nameSee crew_launcher().
workersSee crew_launcher().
seconds_intervalSee crew_launcher().
seconds_timeoutSee crew_launcher().
seconds_launchSee crew_launcher().
seconds_idleSee crew_launcher().
seconds_wallSee crew_launcher().
tasks_maxSee crew_launcher().
tasks_timersSee crew_launcher().
tlsSee crew_launcher().
r_argumentsSee crew_launcher().
options_metricsSee crew_launcher().
urlWebsocket URL for worker connections.
profilemirai compute profile of the launcher.
launchesData frame tracking worker launches with one row
per launch. Each launch may create more than one worker.
Old superfluous rows are periodically discarded for efficiency.
The handle column is used internally for testing and
worker launching logic only.
Handles are not guaranteed to
persist for the full duration of a pipeline:
crew prunes old rows as workers connect and disconnect,
so handles may become unavailable in long-running
or high-throughput workflows.
throttleA crew_throttle() object to throttle scaling.
failedNumber of failed worker launches
(launches that exceed seconds_launch seconds to dial in).
new()Launcher constructor.
crew_class_launcher$new( name = NULL, workers = NULL, seconds_interval = NULL, seconds_timeout = NULL, seconds_launch = NULL, seconds_idle = NULL, seconds_wall = NULL, seconds_exit = NULL, tasks_max = NULL, tasks_timers = NULL, reset_globals = NULL, reset_packages = NULL, reset_options = NULL, garbage_collection = NULL, crashes_error = NULL, launch_max = NULL, tls = NULL, processes = NULL, r_arguments = NULL, options_metrics = NULL )
nameSee crew_launcher().
workersSee crew_launcher().
seconds_intervalSee crew_launcher().
seconds_timeoutSee crew_launcher().
seconds_launchSee crew_launcher().
seconds_idleSee crew_launcher().
seconds_wallSee crew_launcher().
seconds_exitSee crew_launcher().
tasks_maxSee crew_launcher().
tasks_timersSee crew_launcher().
reset_globalsDeprecated. See crew_launcher().
reset_packagesDeprecated. See crew_launcher().
reset_optionsDeprecated. See crew_launcher().
garbage_collectionDeprecated. See crew_launcher().
crashes_errorSee crew_launcher().
launch_maxDeprecated.
tlsSee crew_launcher().
processesDeprecated on 2025-08-27 (crew version 1.2.1.9009).
r_argumentsSee crew_launcher().
options_metricsSee crew_launcher().
An R6 object with the launcher.
if (identical(Sys.getenv("CREW_EXAMPLES"), "true")) {
client <- crew_client()
client$start()
launcher <- crew_launcher_local()
launcher$start(url = client$url, profile = client$profile)
launcher$launch()
task <- mirai::mirai("result", .compute = client$profile)
mirai::call_mirai(task)
task$data
client$terminate()
}
validate()Validate the launcher.
crew_class_launcher$validate()
NULL (invisibly).
poll()Poll the throttle.
crew_class_launcher$poll()
TRUE to run whatever work comes next, FALSE to skip
until the appropriate time.
settings()List of arguments for mirai::daemon().
crew_class_launcher$settings()
List of arguments for mirai::daemon().
call()Create a call to crew_worker() to
help create custom launchers.
crew_class_launcher$call(worker = NULL)
workerDeprecated on 2025-08-28 (crew version 1.2.1.9009).
Character string with a call to crew_worker().
launcher <- crew_launcher_local() launcher$start(url = "tcp://127.0.0.1:57000", profile = "profile") launcher$call() launcher$terminate()
start()Start the launcher.
crew_class_launcher$start(url = NULL, profile = NULL, sockets = NULL)
urlCharacter string, websocket URL for worker connections.
profileCharacter string, mirai compute profile.
socketsDeprecated on 2025-01-28 (crew version 1.0.0).
NULL (invisibly).
terminate()Terminate the whole launcher, including all workers.
crew_class_launcher$terminate()
NULL (invisibly).
launch()Launch a worker.
crew_class_launcher$launch(n = 1L)
nPositive integer, number of workers to launch.
Handle of the launched worker (stored internally for
auto-scaling logic and testing but not
guaranteed to persist; see the launches field).
launch_worker()Abstract worker launch method.
crew_class_launcher$launch_worker(call)
callCharacter of length 1 with a namespaced call to
crew_worker() which will run in the worker and accept tasks.
Launcher plugins will overwrite this method.
A handle to mock the worker launch.
Handles are used internally for testing and
worker launching logic only. They are not guaranteed
to persist in long-running or high-throughput pipelines
(see the launches field).
launch_workers()Launch multiple workers.
crew_class_launcher$launch_workers(call, n)
callCharacter of length 1 with a namespaced call to
crew_worker() which will run in each worker and accept tasks.
nPositive integer, number of workers to launch.
Launcher plugins may overwrite this method to launch multiple workers from a single system call.
A handle to mock the worker launch.
Handles are used internally for testing and
worker launching logic only. They are not guaranteed
to persist in long-running or high-throughput pipelines
(see the launches field).
scale()Auto-scale workers out to meet the demand of tasks.
crew_class_launcher$scale(status, throttle = NULL)
statusA mirai status list with worker and task information.
throttleDeprecated, only used in the controller
as of 2025-01-16 (crew version 0.10.2.9003).
Invisibly returns TRUE if there was any relevant
auto-scaling activity (new worker launches or worker
connection/disconnection events) (FALSE otherwise).
terminate_workers()Deprecated on 2025-08-26
(crew version 1.2.1.9004).
crew_class_launcher$terminate_workers()
NULL (invisibly).
crashes()Deprecated on 2025-01-28 (crew version 1.0.0).
crew_class_launcher$crashes(index = NULL)
indexUnused argument.
The integer 1, for compatibility.
set_name()Deprecated on 2025-01-28 (crew version 1.0.0).
crew_class_launcher$set_name(name)
nameName to set for the launcher.
NULL (invisibly).
clone()The objects of this class are cloneable with this method.
crew_class_launcher$clone(deep = FALSE)
deepWhether to make a deep clone.
Other launcher:
crew_launcher()
if (identical(Sys.getenv("CREW_EXAMPLES"), "true")) {
client <- crew_client()
client$start()
launcher <- crew_launcher_local()
launcher$start(url = client$url, profile = client$profile)
launcher$launch()
task <- mirai::mirai("result", .compute = client$profile)
mirai::call_mirai(task)
task$data
client$terminate()
}
## ------------------------------------------------
## Method `crew_class_launcher$new`
## ------------------------------------------------
if (identical(Sys.getenv("CREW_EXAMPLES"), "true")) {
client <- crew_client()
client$start()
launcher <- crew_launcher_local()
launcher$start(url = client$url, profile = client$profile)
launcher$launch()
task <- mirai::mirai("result", .compute = client$profile)
mirai::call_mirai(task)
task$data
client$terminate()
}
## ------------------------------------------------
## Method `crew_class_launcher$call`
## ------------------------------------------------
launcher <- crew_launcher_local()
launcher$start(url = "tcp://127.0.0.1:57000", profile = "profile")
launcher$call()
launcher$terminate()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.