| crew_class_launcher_local | R Documentation |
R6 class to launch and manage local process workers.
See crew_launcher_local().
crew::crew_class_launcher -> crew_class_launcher_local
options_localSee crew_launcher_local().
crew::crew_class_launcher$call()crew::crew_class_launcher$crashes()crew::crew_class_launcher$launch()crew::crew_class_launcher$poll()crew::crew_class_launcher$resolve()crew::crew_class_launcher$scale()crew::crew_class_launcher$set_name()crew::crew_class_launcher$settings()crew::crew_class_launcher$start()crew::crew_class_launcher$terminate()crew::crew_class_launcher$terminate_workers()crew::crew_class_launcher$update()new()Local launcher constructor.
crew_class_launcher_local$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, crashes_error = NULL, tls = NULL, processes = NULL, r_arguments = NULL, options_metrics = NULL, options_local = 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().
crashes_errorSee crew_launcher().
tlsSee crew_launcher().
processesSee crew_launcher().
r_argumentsSee crew_launcher().
options_metricsSee crew_launcher_local().
options_localSee crew_launcher_local().
reset_globalsDeprecated. See crew_launcher().
reset_packagesDeprecated. See crew_launcher().
reset_optionsDeprecated. See crew_launcher().
garbage_collectionDeprecated. See crew_launcher().
An R6 object with the local launcher.
if (identical(Sys.getenv("CREW_EXAMPLES"), "true")) {
client <- crew_client()
client$start()
launcher <- crew_launcher_local(name = client$name)
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 local launcher.
crew_class_launcher_local$validate()
NULL (invisibly).
launch_worker()Launch a local process worker which will dial into a socket.
crew_class_launcher_local$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 a long informative worker name
which contains the launcher and worker arguments
described below.
launcherCharacter of length 1, name of the launcher.
workerCharacter string, name of the worker within the launcher.
The call argument is R code that will run to
initiate the worker. Together, the launcher, worker,
and instance arguments are useful for
constructing informative job names.
A handle object to allow the termination of the worker later on.
terminate_worker()Terminate a local process worker.
crew_class_launcher_local$terminate_worker(handle)
handleA process handle object previously
returned by launch_worker().
A list with the process ID of the worker.
Other plugin_local:
crew_controller_local(),
crew_launcher_local()
if (identical(Sys.getenv("CREW_EXAMPLES"), "true")) {
client <- crew_client()
client$start()
launcher <- crew_launcher_local(name = client$name)
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_local$new`
## ------------------------------------------------
if (identical(Sys.getenv("CREW_EXAMPLES"), "true")) {
client <- crew_client()
client$start()
launcher <- crew_launcher_local(name = client$name)
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()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.