Sequential controller class
Source:R/crew_controller_sequential.R
crew_class_controller_sequential.RdR6 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$size()crew::crew_class_controller$started()crew::crew_class_controller$summary()crew::crew_class_controller$validate()crew::crew_class_controller$walk()
Method resolved()
Number of resolved tasks.
Arguments
controllersNot used. Included to ensure the signature is compatible with the analogous method of controller groups.
Method unresolved()
Number of unresolved tasks.
Method saturated()
Check if the controller is saturated.
Usage
crew_class_controller_sequential$saturated(
collect = NULL,
throttle = NULL,
controller = NULL
)Method start()
Start the controller if it is not already started.
Arguments
controllersNot 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 descale()
Not applicable to the sequential controller.
Method push()
Push a task to the head of the task list.
Arguments
commandLanguage object with R code to run.
dataNamed list of local data objects in the evaluation environment.
globalsNamed 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_globalsargument ofcrew_controller_local().substituteLogical of length 1, whether to call
base::substitute()on the supplied value of thecommandargument. IfTRUE(default) thencommandis quoted literally as you write it, e.g.push(command = your_function_call()). IfFALSE, thencrewassumescommandis a language object and you are passing its value, e.g.push(command = quote(your_function_call())).substitute = TRUEis appropriate for interactive use, whereassubstitute = FALSEis meant for automated R programs that invokecrewcontrollers.seedInteger of length 1 with the pseudo-random number generator seed to set for the evaluation of the task. Passed to the
seedargument ofset.seed()if notNULL. Ifalgorithmandseedare bothNULLfor the sequential controller, then the random number generator defaults to the current RNG of the local R session where the sequential controller lives.algorithmInteger of length 1 with the pseudo-random number generator algorithm to set for the evaluation of the task. Passed to the
kindargument ofRNGkind()if notNULL. Ifalgorithmandseedare bothNULLfor the sequential controller, then the random number generator defaults to the current RNG of the local R session where the sequential controller lives.packagesCharacter vector of packages to load for the task.
libraryLibrary path to load the packages. See the
lib.locargument ofrequire().seconds_timeoutNot used in the sequential controller..
scaleNot used in the sequential controller.
throttleNot used in the sequential controller.
nameCharacter 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_commandDeprecated on 2025-01-22 (
crewversion 0.10.2.9004) and no longer used.controllerNot 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
modeNot applicable to the sequential controller.
seconds_intervalNot applicable to the sequential controller.
seconds_timeoutNot applicable to the sequential controller.
scaleNot applicable to the sequential controller.
throttleNot applicable to the sequential controller.
controllersNot 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()
}