crew_controller_local {crew} | R Documentation |
Create a controller with a local process launcher.
Description
Create an R6
object to submit tasks and
launch workers on local processes.
Usage
crew_controller_local(
name = NULL,
workers = 1L,
host = "127.0.0.1",
port = NULL,
tls = crew::crew_tls(),
tls_enable = NULL,
tls_config = NULL,
seconds_interval = 0.5,
seconds_timeout = 60,
seconds_launch = 30,
seconds_idle = Inf,
seconds_wall = Inf,
seconds_exit = NULL,
retry_tasks = TRUE,
tasks_max = Inf,
tasks_timers = 0L,
reset_globals = TRUE,
reset_packages = FALSE,
reset_options = FALSE,
garbage_collection = FALSE,
launch_max = 5L,
local_log_directory = NULL,
local_log_join = TRUE
)
Arguments
name |
Name of the client object. If |
workers |
Integer, maximum number of parallel workers to run. |
host |
IP address of the |
port |
TCP port to listen for the workers. If |
tls |
A TLS configuration object from |
tls_enable |
Deprecated on 2023-09-15 in version 0.4.1.
Use argument |
tls_config |
Deprecated on 2023-09-15 in version 0.4.1.
Use argument |
seconds_interval |
Number of seconds between
polling intervals waiting for certain internal
synchronous operations to complete,
such as checking |
seconds_timeout |
Number of seconds until timing
out while waiting for certain synchronous operations to complete,
such as checking |
seconds_launch |
Seconds of startup time to allow.
A worker is unconditionally assumed to be alive
from the moment of its launch until |
seconds_idle |
Maximum number of seconds that a worker can idle
since the completion of the last task. If exceeded, the worker exits.
But the timer does not launch until |
seconds_wall |
Soft wall time in seconds.
The timer does not launch until |
seconds_exit |
Deprecated on 2023-09-21 in version 0.5.0.9002. No longer necessary. |
retry_tasks |
|
tasks_max |
Maximum number of tasks that a worker will do before
exiting. See the |
tasks_timers |
Number of tasks to do before activating
the timers for |
reset_globals |
|
reset_packages |
|
reset_options |
|
garbage_collection |
|
launch_max |
Positive integer of length 1, maximum allowed
consecutive launch attempts which do not complete any tasks.
Enforced on a worker-by-worker basis.
The futile launch count resets to back 0
for each worker that completes a task.
It is recommended to set |
local_log_directory |
Either |
local_log_join |
Logical of length 1. If |
See Also
Other plugin_local:
crew_class_launcher_local
,
crew_launcher_local()
Examples
if (identical(Sys.getenv("CREW_EXAMPLES"), "true")) {
controller <- crew_controller_local()
controller$start()
controller$push(name = "task", command = sqrt(4))
controller$wait()
controller$pop()
controller$terminate()
}