The Task Pipeline
Tasks are run and managed within the task pipeline.
bootstrap
A shortcut to configuring a task pipeline is using the bootstrap method:
from cadence import bootstrap
if __name__ == "__main__":
bootstrap()
The bootstrap method:
- Configures a logger named
cadenceandcadence-subprocess - Configures and starts the task pipeline
- Registers an exit event which stops the pipeline and the tasks it manages when the application stops
The bootstrap method takes the following arguments:
| Name | Type | Default | Description |
|---|---|---|---|
max_threads | Optional[int] | 4 | The max number of tasks that will run concurrently. |
run_scheduler | Optional[bool] | true | Whether to automatically run the pipeline. |
hooks | Optional[TaskPipelineHooks] | [] | A registry of pipeline and task lifecycle hooks. |
tasks | Optional[list[Task]] | [] | A list of tasks to run. |