- Overview
- receive_mesh_task
receive_mesh_task
Part of Reusable workflows in the Python API reference.
Related guidance: shipped-tooling.
Runnable examples: receive_mesh_task.py.
from picogrid_ecn_client.workflows import receive_mesh_taskRegister an echo handler for a terminal-addressed deployment route.
async def receive_mesh_task( client: ECNClient, *, terminal_id: UUID, entity_id: UUID, command: str, task_limit: int = 0, on_event: Callable[[TaskRequestContext], None] | None = None, on_registered: Callable[[TaskRegistration], None] | None = None,) -> ReceiveMeshTaskResultParameters
Section titled “Parameters”| Name | Type | Default | Description |
|---|---|---|---|
| client | ECNClient | — | Configured SDK client used to register the handler. |
| terminal_id | UUID | — | Local terminal identity that must match the client configuration. |
| entity_id | UUID | — | Canonical identity that owns the task handler. |
| command | str | — | Exact command name accepted by the handler. |
| task_limit | int | 0 | Requests to handle before cleanup; zero waits until interrupted while retaining only the most recent configured watcher buffer. |
| on_event | Callable[[TaskRequestContext], None] | None | None | Optional callback invoked for every accepted request context. |
| on_registered | Callable[[TaskRegistration], None] | None | None | Optional callback invoked after registration succeeds. |
Returns
Section titled “Returns”| Type | Description |
|---|---|
| ReceiveMeshTaskResult | Terminal identity and registration metadata plus all positive-limit requests, or the most recently retained contexts and results from an unbounded receiver. |
Raises
Section titled “Raises”| Exception | Description |
|---|---|
| ValidationError | If terminal_id mismatches, task_limit is negative, a request arrives from a source other than a canonical source terminal, or a request arrives after the configured limit has been accepted. |
| ECNClientError | If registration, request handling, or cleanup fails. |
Version 0.2.0 · branch main
