Skip to main content

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 cadence and cadence-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:

NameTypeDefaultDescription
max_threadsOptional[int]4The max number of tasks that will run concurrently.
run_schedulerOptional[bool]trueWhether to automatically run the pipeline.
hooksOptional[TaskPipelineHooks][]A registry of pipeline and task lifecycle hooks.
tasksOptional[list[Task]][]A list of tasks to run.