Task Run¶
It can be imported from fluid.scheduler:
fluid.scheduler.TaskRun
pydantic-model
¶
Bases: BaseModel, Generic[TP]
A TaskRun contains all the data generated by a Task run
This model is never initialized directly, it is created by the TaskManager
Fields:
-
id(str) -
task(Task) -
priority(TaskPriority) -
params(TP) -
state(TaskState) -
task_manager(TaskManager) -
queued(datetime | None) -
start(datetime | None) -
end(datetime | None) -
execute_after(datetime | None) -
rate_limit_attempt(int) -
retry_attempt(int)
execute_after
pydantic-field
¶
Do not execute before this UTC timestamp. Set by retry logic.
rate_limit_attempt
pydantic-field
¶
Number of rate-limit retries already consumed.
abort
¶
set_state
¶
Set the state of the task run, with proper handling of timestamps and state transitions.
This method is called by the task consumer and should not be called directly by the task executor.