abstractRoutine <Output, Input, Options>
Hierarchy
- WorkUnit<Options, Input, Output>
- Routine
Index
Events
Other
Events
readonlyonCommand
readonlyonCommandData
Called while a command is being executed.
readonlyonFail
Called when an execution fails.
readonlyonPass
Called when an execution succeeds.
readonlyonRun
Called before a work unit is executed. Can return true
to skip the work unit.
readonlyonSkip
Called when an execution is skipped.
Other
constructor
Type parameters
- Output = unknown
- Input = unknown
- Options: object = {}
readonlydebug
depth
Current depth of nested pipelines.
index
Current index amongst sibling work units.
optionalinput
readonlykey
readonlyoptions
Validated and configured options.
optionaloutput
startTime
statusText
stopTime
readonlytitle
id
Return a unique hierarchical ID.
abstractblueprint
Define an
optimal
blueprint in which to validate and build the options object passed to the constructor, or when manual setting.A boolean is passed as the 2nd argument to determine whether this is validating on class instantiation (first time), or by calling
configure()
(all other times).
configure
Set an options object by merging the new partial and existing options with the defined blueprint, while running all validation checks. Freeze and return the options object.
object.configure({ name: 'Boost' });
object.configure((prevOptions) => ({
nestedObject: {
...prevOptions.nestedObject,
some: 'value',
},
}));
createAggregatedPipeline
Create and return a
AggregatedPipeline
. This pipeline will execute all work units in parallel without interruption. Returns an object with a list of errors and results once all resolve.Type parameters
- C: Context
- I = unknown
- O = I
createConcurrentPipeline
Create and return a
ConcurrentPipeline
. This pipeline will execute all work units in parallel. Returns a list of values once all resolve.Type parameters
- C: Context
- I = unknown
- O = I
createPooledPipeline
Create and return a
PooledPipeline
. This pipeline will execute a distinct set of work units in parallel without interruption, based on a max concurrency, until all work units have ran. Returns a list of errors and results once all resolve.Type parameters
- C: Context
- I = unknown
- O = I
createWaterfallPipeline
Create and return a
WaterfallPipeline
. This pipeline will execute each work unit one by one, with the return value of the previous being passed to the next. Returns the final value once all resolve.Type parameters
- C: Context
- I = unknown
abstractexecute
Execute the current routine and return a new value.
executeCommand
Execute a command with the given arguments and pass the results through a promise.
hasFailed
Return true if the task failed when executing.
hasPassed
Return true if the task executed successfully.
isComplete
Return true if the task has been completed in any form.
isPending
Return true if the task has not been executed yet.
isRunning
Return true if the task is currently running.
isSkipped
Return true if the task was or will be skipped.
run
Run the current task by executing it and performing any before and after processes.
setMonitor
Set the monitor to pass to nested pipelines.
skip
Mark a task as skipped if the condition is true.
Called after
execa
was executed.