prefect.task_engine
Functions
run_task_sync
run_task_async
run_generator_task_sync
run_generator_task_async
run_task
task
: The task to runtask_run_id
: The ID of the task run; if not provided, a new task run will be createdtask_run
: The task run object; if not provided, a new task run will be createdparameters
: The parameters to pass to the taskwait_for
: A list of futures to wait for before running the taskreturn_type
: The return type to return; either “state” or “result”dependencies
: A dictionary of task run inputs to use for dependency trackingcontext
: A dictionary containing the context to use for the task run; only required if the task is running on in a remote environment
- The result of the task run
Classes
TaskRunTimeoutError
Raised when a task run exceeds its timeout.
BaseTaskRunEngine
Methods:
compute_transaction_key
handle_rollback
is_cancelled
is_running
log_finished_message
record_terminal_state_timing
state
SyncTaskRunEngine
Methods:
asset_context
begin_run
call_hooks
call_task_fn
can_retry
client
handle_crash
handle_exception
handle_retry
- If the task has retries left, and the retry condition is met, set the task to retrying and return True.
- If the task has a retry delay, place in AwaitingRetry state with a delayed scheduled time.
- If the task has no retries left, or the retry condition is not met, return False.
handle_success
handle_timeout
initialize_run
result
run_context
set_state
setup_run_context
start
transaction_context
wait_until_ready
AsyncTaskRunEngine
Methods:
asset_context
begin_run
call_hooks
call_task_fn
can_retry
client
handle_crash
handle_exception
handle_retry
- If the task has retries left, and the retry condition is met, set the task to retrying and return True.
- If the task has a retry delay, place in AwaitingRetry state with a delayed scheduled time.
- If the task has no retries left, or the retry condition is not met, return False.