Represent a task object
Return the current task config
Set the task name
Create a new hook
Set the main task action
Set the task config
Set the initialization function. It's one-time shortcut for addHook('onInit', fn)
Set the initialization function. It's one-time shortcut for addHook('onRollback', fn)
Represent the centric task registry
Add a new task to the registry.
Set the refs
property of the task config to configure task dependencies
Merge the value to the task config
Configure a shared config from which all tasks inherit
addHook(String: taskName, string: ['onInit', 'onBefore', 'onAfter'], async function: handler) : Task
Add a hook to the task
Represent pipeline to execute all tasks
Run the pipeline. We don't provide a finish callback because it's a queue and is changed at runtime.
Try to get the value from the result of this task, otherwise the value is taken from the task config. That's the reason to provide always a default value in the task config.
{
"a": 1,
"refs": {
"a": "previousTaskName"
}
}
The whole pipeline is rollbacked and all onRollback
hooks from all tasks are called.
The whole pipeline is restored and all onRollback
hooks from all tasks are called. The difference between a rollback
and restore
is that a restore is intentional and therefore no onBefore
, onAfter
hooks are called only onInit
.
Check if a task has thrown an error
Check if a task has respond with a truthy value
Add a global onTaskStart
hook. This hook is executed before a task is executed.
Add a global onTaskEnd
hook. This hook is executed after a task was executed.
Add a global onTaskRollback
hook. This hook is executed after a complete rollback was proceed.
State provide an api to add additional tasks and access to the current pipeline instance.
Execute a job. A job is a single function and is excuted in creation order. The parent task is waiting before all sub-jobs are done.
Execute a task. The task is excuted in creation order. The parent task is waiting before all sub-tasks are done.
This is shortcut for getValue(String: taskName)