| 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().
processesSee crew_launcher().
asynchronously.
r_argumentsSee crew_launcher().
options_metricsSee crew_launcher().
urlWebsocket URL for worker connections.
profilemirai compute profile of the launcher.
instancesData frame of worker instance information.
idInteger worker ID from the last call to settings().
asyncA crew_async() object to run low-level launcher tasks
asynchronously.
throttleA crew_throttle() object to throttle scaling.
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().
processesSee crew_launcher().
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, socket = NULL, launcher = NULL, instance = NULL )
workerCharacter string, name of the worker.
socketDeprecated on 2025-01-28 (crew version 1.0.0).
launcherDeprecated on 2025-01-28 (crew version 1.0.0).
instanceDeprecated on 2025-01-28 (crew version 1.0.0).
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(worker = "worker_name") 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).
resolve()Resolve asynchronous worker submissions.
crew_class_launcher$resolve()
NULL (invisibly). Throw an error if there were any
asynchronous worker submission errors.'
update()Update worker metadata, resolve asynchronous worker submissions, and terminate lost workers.
crew_class_launcher$update(status)
statusA mirai status list.
NULL (invisibly).
launch()Launch a worker.
crew_class_launcher$launch()
Handle of the launched worker.
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).
launch_worker()Abstract worker launch method.
crew_class_launcher$launch_worker(call, name, launcher, worker)
callCharacter of length 1 with a namespaced call to
crew_worker() which will run in the worker and accept tasks.
nameCharacter of length 1 with an informative worker name.
launcherCharacter of length 1, name of the launcher.
workerPositive integer of length 1, index of the worker. This worker index remains the same even when the current instance of the worker exits and a new instance launches. It is always between 1 and the maximum number of concurrent workers.
Launcher plugins will overwrite this method.
A handle to mock the worker launch.
terminate_worker()Abstract worker termination method.
crew_class_launcher$terminate_worker(handle)
handleA handle object previously
returned by launch_worker() which allows the termination
of the worker.
Launcher plugins will overwrite this method.
A handle to mock worker termination.
terminate_workers()Terminate all workers.
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).
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(worker = "worker_name")
launcher$terminate()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.