Skip to content

TaskRequestContext

Part of Tasks in the Python API reference.

Related guidance: concepts/tasks, how-to/receive-local-tasks, how-to/dispatch-local-tasks, quickstarts/effector-handler.

Runnable examples: receive_task.py, dispatch_task.py, receive_mesh_task.py, dispatch_mesh_task.py.

from picogrid_ecn_client import TaskRequestContext

Describe the local context supplied to a registered task handler.

TaskRequestContext(
*,
task_id: str,
target_entity_id: UUID,
command: str,
source: Literal['local'] | UUID,
mode: TaskMode,
received_at: datetime,
)

Source · models/task.py

NameTypeRequiredDefaultConstraintsDescription
task_idstryesmin_length=1, max_length=128Task correlation identifier, from 1 through 128 characters.
target_entity_idUUIDyesUUID of the entity targeted by the task.
commandstryesmin_length=1, max_length=128Registered command name, from 1 through 128 characters.
sourceLiteral[‘local’] | UUIDyesLiteral ‘local’ compatibility source or canonical source-terminal UUID.
modeTaskModeyesCompletion behavior requested by the sender.
received_atdatetimeyesTimezone-aware UTC time when the task request was received locally.

Version 0.2.0 · branch main