Sequential controller class
Source:R/crew_controller_sequential.R
crew_class_controller_sequential.Rd
R6
class for sequential controllers.
See also
Other sequential controllers:
crew_controller_sequential()
Super class
crew::crew_class_controller
-> crew_class_controller_sequential
Methods
Inherited methods
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()
Method start()
Start the controller if it is not already started.
Arguments
controllers
Not used. Included to ensure the signature is compatible with the analogous method of controller groups.
Method launch()
Does nothing for the sequential controller.
Method scale()
Does nothing for the sequential controller.
Method autoscale()
Not applicable to the sequential controller.
Method descale()
Not applicable to the sequential controller.
Method push()
Push a task to the head of the task list.
Arguments
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 ofcrew_controller_local()
.substitute
Logical of length 1, whether to call
base::substitute()
on the supplied value of thecommand
argument. IfTRUE
(default) thencommand
is quoted literally as you write it, e.g.push(command = your_function_call())
. IfFALSE
, thencrew
assumescommand
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, whereassubstitute = FALSE
is meant for automated R programs that invokecrew
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 ofset.seed()
if notNULL
. Ifalgorithm
andseed
are bothNULL
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 ofRNGkind()
if notNULL
. Ifalgorithm
andseed
are bothNULL
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 ofrequire()
.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.
Method wait()
Not applicable to the sequential controller.
Usage
crew_class_controller_sequential$wait(
mode = "all",
seconds_interval = NULL,
seconds_timeout = Inf,
scale = TRUE,
throttle = TRUE,
controllers = NULL
)
Arguments
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.
Method push_backlog()
Not applicable to the sequential controller.
Method pop_backlog()
Not applicable to the sequential controller.
Method cancel()
Not applicable to the sequential controller.
Usage
crew_class_controller_sequential$cancel(names = character(0L), all = FALSE)
Examples
if (identical(Sys.getenv("CREW_EXAMPLES"), "true")) {
controller <- crew_controller_sequential()
controller$push(name = "task", command = sqrt(4))
controller$pop()
}