Skip to main content

Module server

Module server 

Source
Expand description

Unix-socket accept loop + per-connection line-delimited JSON dispatch to verb handlers. The HTTP-over-TCP transport (crate::http_server) speaks the same frame shapes, so dispatch logic is shared.

Enums§

DispatchOutcome
What dispatch returns. One-shot verbs (ping, stats, …) produce a single result/error frame; streaming verbs (tail_flow) produce a sequence of Event frames terminated by an End frame.

Constants§

MAX_NDJSON_LINE_BYTES
Hard cap on the size of one NDJSON request line. Aligns with the 1 MiB body cap on the HTTP transport so both faces of the mgmt plane reject the same magnitude of oversized input. A real verb payload is well under a kilobyte; anything larger is either a malformed framing or an adversarial slowloris-by-line attack.

Traits§

EventStream
A streaming event source. The server polls next_event until the client disconnects or the stream returns None.
Handler
Server-side dispatcher. Callers implement this against their own application state and pass an Arc<H> to spawn_unix_server or crate::spawn_http_server.

Functions§

spawn_unix_server
Bind a Unix socket and serve mgmt requests until cancel fires.