pi_portal.modules.tasks.task.bases.task_fields.TaskFields

class pi_portal.modules.tasks.task.bases.task_fields.TaskFields(completed: datetime | None, created: datetime, id: Any, ok: bool | None, result: TaskResult[TypeTaskResult], retry_after: int, routing_label: RoutingLabel, scheduled: datetime | None)[source]

Bases: Generic[TypeTaskResult]

The fields used by all task classes.

__init__(completed: datetime | None, created: datetime, id: Any, ok: bool | None, result: TaskResult[TypeTaskResult], retry_after: int, routing_label: RoutingLabel, scheduled: datetime | None) None
completed: datetime | None

The datetime of completion, or None if not complete.

created: datetime

The datetime of task creation.

id: Any

The id (assigned by the queue) for this task.

ok: bool | None

Set to None before job completion, afterward a boolean job status.

result: TaskResult[TypeTaskResult]

Set to None before job completion, afterward returned results.

retry_after: int

A positive value in seconds ensures this task will be retried on failure.

routing_label: RoutingLabel

The routing label for this task.

scheduled: datetime | None

Set to None before job completion, afterward returned results.