- Overview
- RequestTaskHandler
RequestTaskHandler
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 RequestTaskHandlerHandle a validated task request without dispatch context.
class RequestTaskHandler(Protocol[RequestT_contra, ResultT_co]): ...__call__
Section titled “__call__”Invoke the handler with a validated request.
def __call__( request: RequestT_contra, /,) -> Coroutine[Any, Any, ResultT_co | TaskResult[ResultT_co] | Mapping[str, JsonValue] | None]Parameters
Section titled “Parameters”| Name | Type | Default | Description |
|---|---|---|---|
| request | RequestT_contra | — | Request model validated before invocation. |
Returns
Section titled “Returns”| Type | Description |
|---|---|
| Coroutine[Any, Any, ResultT_co | TaskResult[ResultT_co] | Mapping[str, JsonValue] | None] | A coroutine resolving to a result model, task result, JSON mapping, or None. Registration rejects non-async callables, so the protocol requires a coroutine rather than any awaitable. |
Version 0.2.0 · branch main
