handler
handler
¶
JSON-RPC request handler — routes methods to async callables.
Provides a generic RequestHandler that maps JSON-RPC method names
(e.g. "daemon.status", "job.submit") to async handler functions.
Handles param validation errors and unknown methods, returning proper
JSON-RPC error responses.
The handler is decoupled from business logic — actual method implementations are registered externally (by the daemon process in Phase 2).
Classes¶
RequestHandler
¶
Routes JSON-RPC 2.0 requests to registered async method handlers.
Each handler receives (params: dict, writer: StreamWriter) and
returns the result value to embed in the JSON-RPC response.
Streaming handlers (like job.logs) may write directly to the
writer and return None to suppress the automatic response.
Source code in src/marianne/daemon/ipc/handler.py
Attributes¶
Functions¶
register
¶
handle
async
¶
Dispatch request to the appropriate handler.
Returns:
| Type | Description |
|---|---|
JsonRpcResponse | JsonRpcError | None
|
|
JsonRpcResponse | JsonRpcError | None
|
or |
JsonRpcResponse | JsonRpcError | None
|
or the handler wrote the response itself (streaming). |