Tasks are atomic units of work with transactional semantics.
explain_tasks
is an instance of a task.
Tasks are cache-able and retryable units of work that are easy to execute concurrently, in parallel, and/or with transactional semantics.
Like flows, tasks are free to call other tasks or flows, there is no required nesting pattern.
Generally, tasks behave like normal Python functions, but they have some additional capabilities:
.submit()
and .map()
allow concurrent execution within and across workflows.delay()
, background tasks start in a Scheduled
state before transitioning to Pending
. This allows them to be queued and distributed to available workers.@task
decorated function (i.e. __call__
), just like a normal Python function.
Completed
.
Explicit state dependencies can be introduced with the wait_for
parameter.
.delay()
, it pushes the resulting task run onto a server-side topic, which is distributed to an available task worker for execution.