crew_class_controller_sequential | R Documentation |
R6
class for sequential controllers.
See crew_controller_sequential()
.
crew::crew_class_controller
-> crew_class_controller_sequential
crew::crew_class_controller$collect()
crew::crew_class_controller$crashes()
crew::crew_class_controller$empty()
crew::crew_class_controller$initialize()
crew::crew_class_controller$map()
crew::crew_class_controller$nonempty()
crew::crew_class_controller$pids()
crew::crew_class_controller$pop()
crew::crew_class_controller$promise()
crew::crew_class_controller$resolved()
crew::crew_class_controller$saturated()
crew::crew_class_controller$started()
crew::crew_class_controller$summary()
crew::crew_class_controller$terminate()
crew::crew_class_controller$unpopped()
crew::crew_class_controller$unresolved()
crew::crew_class_controller$validate()
crew::crew_class_controller$walk()
start()
Start the controller if it is not already started.
crew_class_controller_sequential$start(controllers = NULL)
controllers
Not used. Included to ensure the signature is compatible with the analogous method of controller groups.
For the sequential controller, there is nothing to do except register the client as started.
NULL
(invisibly).
launch()
Does nothing for the sequential controller.
crew_class_controller_sequential$launch(n = 1L, controllers = NULL)
n
Number of workers to launch.
controllers
Not used. Included to ensure the signature is compatible with the analogous method of controller groups.
NULL
(invisibly).
scale()
Does nothing for the sequential controller.
crew_class_controller_sequential$scale(throttle = TRUE, controllers = NULL)
throttle
Not applicable to the sequential controller.
controllers
Not used. Included to ensure the signature is compatible with the analogous method of controller groups.
Invisibly returns FALSE
.
autoscale()
Not applicable to the sequential controller.
crew_class_controller_sequential$autoscale(controllers = NULL)
controllers
Not used. Included to ensure the signature is compatible with the analogous method of controller groups.
NULL
(invisibly).
descale()
Not applicable to the sequential controller.
crew_class_controller_sequential$descale(controllers = NULL)
controllers
Not used. Included to ensure the signature is compatible with the analogous method of controller groups.
NULL
(invisibly).
push()
Push a task to the head of the task list.
crew_class_controller_sequential$push( command, data = list(), globals = list(), substitute = TRUE, seed = NULL, algorithm = NULL, packages = character(0), library = NULL, seconds_timeout = NULL, scale = TRUE, throttle = TRUE, name = NULL, save_command = NULL, controller = NULL )
command
Language object with R code to run.
data
Named list of local data objects in the evaluation environment.
globals
Named list of objects to temporarily assign to the
global environment for the task.
This list should
include any functions you previously defined in the global
environment which are required to run tasks.
See the reset_globals
argument
of crew_controller_local()
.
substitute
Logical of length 1, whether to call
base::substitute()
on the supplied value of the
command
argument. If TRUE
(default) then command
is quoted
literally as you write it, e.g.
push(command = your_function_call())
. If FALSE
, then crew
assumes command
is a language object and you are passing its
value, e.g. push(command = quote(your_function_call()))
.
substitute = TRUE
is appropriate for interactive use,
whereas substitute = FALSE
is meant for automated R programs
that invoke crew
controllers.
seed
Integer of length 1 with the pseudo-random number generator
seed to set for the evaluation of the task. Passed to the
seed
argument of set.seed()
if not NULL
.
If algorithm
and seed
are both NULL
for the sequential
controller, then the random number generator defaults to the
current RNG of the local R session where the sequential
controller lives.
algorithm
Integer of length 1 with the pseudo-random number
generator algorithm to set for the evaluation of the task.
Passed to the kind
argument of RNGkind()
if not NULL
.
If algorithm
and seed
are both NULL
for the sequential
controller, then the random number generator defaults to the
current RNG of the local R session where the sequential
controller lives.
packages
Character vector of packages to load for the task.
library
Library path to load the packages. See the lib.loc
argument of require()
.
seconds_timeout
Not used in the sequential controller..
scale
Not used in the sequential controller.
throttle
Not used in the sequential controller.
name
Character string, name of the task. If NULL
, then
a random name is generated automatically.
The name of the task must not conflict with the name of another
task pushed to the controller. Any previous task with the same name
must first be popped before a new task with that name can be pushed.
save_command
Deprecated on 2025-01-22 (crew
version
0.10.2.9004) and no longer used.
controller
Not used. Included to ensure the signature is compatible with the analogous method of controller groups.
Invisibly returns a mirai
-like list where the data
element is the result of the task.
wait()
Not applicable to the sequential controller.
crew_class_controller_sequential$wait( mode = "all", seconds_interval = NULL, seconds_timeout = Inf, scale = TRUE, throttle = TRUE, controllers = NULL )
mode
Not applicable to the sequential controller.
seconds_interval
Not applicable to the sequential controller.
seconds_timeout
Not applicable to the sequential controller.
scale
Not applicable to the sequential controller.
throttle
Not applicable to the sequential controller.
controllers
Not used. Included to ensure the signature is compatible with the analogous method of controller groups.
Always returns TRUE
(invisibly)
for the sequential controller.
push_backlog()
Not applicable to the sequential controller.
crew_class_controller_sequential$push_backlog(name, controller = NULL)
name
Character of length 1 with the task name to push to the backlog.
controller
Not used. Included to ensure the signature is compatible with the analogous method of controller groups.
NULL
(invisibly).
pop_backlog()
Not applicable to the sequential controller.
crew_class_controller_sequential$pop_backlog(controllers = NULL)
controllers
Not used. Included to ensure the signature is compatible with the analogous method of controller groups.
Always character(0L)
for the sequential controller.
cancel()
Not applicable to the sequential controller.
crew_class_controller_sequential$cancel(names = character(0L), all = FALSE)
names
Not applicable to the sequential controller.
all
Not applicable to the sequential controller.
Other sequential controllers:
crew_controller_sequential()
if (identical(Sys.getenv("CREW_EXAMPLES"), "true")) {
controller <- crew_controller_sequential()
controller$push(name = "task", command = sqrt(4))
controller$pop()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.