Index
ipc
¶
IPC layer for the conductor — Unix socket + JSON-RPC 2.0.
Classes¶
DaemonClient
¶
Async client for the Marianne daemon Unix socket IPC.
Parameters¶
socket_path:
Path to the Unix domain socket created by DaemonServer.
timeout:
Seconds to wait for a response before raising TimeoutError.
pool_size:
Maximum number of pooled connections for call().
Source code in src/marianne/daemon/ipc/client.py
Functions¶
close
async
¶
call
async
¶
Send a JSON-RPC request and return the result.
Uses the connection pool. If a pooled connection is stale (server closed it, daemon restarted), discards it and retries once with a fresh connection.
Raises:
| Type | Description |
|---|---|
DaemonNotRunningError
|
socket unreachable |
DaemonError(subclass)
|
server returned an error response |
TimeoutError
|
no response within |
Source code in src/marianne/daemon/ipc/client.py
stream
async
¶
Send a JSON-RPC request and yield streaming notifications.
Notifications (no id) are yielded as dicts. The final
response (with id) terminates the iteration.
If the final response contains an error, raises the
corresponding DaemonError.
Source code in src/marianne/daemon/ipc/client.py
is_daemon_running
async
¶
Check if daemon is running by performing a lightweight health RPC.
Uses daemon.health instead of bare socket connect so stale
sockets left by crashed daemons are properly detected.
Short-circuits immediately if the socket path doesn't exist,
consistent with _connect()'s guard.
Source code in src/marianne/daemon/ipc/client.py
status
async
¶
submit_job
async
¶
get_job_status
async
¶
Get status of a specific job.
pause_job
async
¶
Pause a running job. Returns {"paused": bool}.
Source code in src/marianne/daemon/ipc/client.py
resume_job
async
¶
Resume a paused job. Returns a JobResponse dict.
Source code in src/marianne/daemon/ipc/client.py
cancel_job
async
¶
Cancel a running or paused job. Returns {"cancelled": bool}.
Source code in src/marianne/daemon/ipc/client.py
list_jobs
async
¶
clear_jobs
async
¶
Clear terminal jobs from the daemon registry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
statuses
|
list[str] | None
|
Status filter (defaults to terminal statuses). |
None
|
older_than_seconds
|
float | None
|
Only clear jobs older than this. |
None
|
job_ids
|
list[str] | None
|
Only clear these specific job IDs. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dict with "deleted" count. |
Source code in src/marianne/daemon/ipc/client.py
config
async
¶
health
async
¶
readiness
async
¶
get_errors
async
¶
Get errors for a specific job.
Source code in src/marianne/daemon/ipc/client.py
diagnose
async
¶
Get diagnostic data for a specific job.
Source code in src/marianne/daemon/ipc/client.py
get_execution_history
async
¶
Get execution history for a specific job.
Source code in src/marianne/daemon/ipc/client.py
recover_job
async
¶
Request recovery data for a specific job.
Source code in src/marianne/daemon/ipc/client.py
rate_limits
async
¶
learning_patterns
async
¶
Get recent learning patterns from the global store.
DaemonServer
¶
DaemonServer(socket_path, handler, *, permissions=432, max_connections=DEFAULT_MAX_CONNECTIONS, max_concurrent_requests=DEFAULT_MAX_CONCURRENT_REQUESTS)
Async Unix domain socket server with JSON-RPC 2.0 routing.
Parameters¶
socket_path:
Filesystem path for the Unix domain socket.
handler:
RequestHandler that dispatches JSON-RPC methods.
permissions:
Octal file permissions applied to the socket after creation.
Defaults to 0o660 (owner + group read/write).
max_connections:
Maximum simultaneous connected clients. FD protection — idle
connections are cheap, so the default is high (~500).
max_concurrent_requests:
Maximum requests being processed at once across all connections.
This is the real concurrency control (~50).
Source code in src/marianne/daemon/ipc/server.py
Attributes¶
Functions¶
start
async
¶
Bind the Unix socket and start accepting connections.
Source code in src/marianne/daemon/ipc/server.py
stop
async
¶
Stop the server, cancel active connections, and remove the socket.