Module host_pipe

Module host_pipe 

Source

Modules§

connection 🔒

Structs§

HostPipe
Public wrapper around the launcher → host pipe.
HostPipeInner 🔒
PendingFrame 🔒
One frame waiting to be written to the host. Tracks the saga_id when known so we can emit a meaningful SagaFailed if the frame is dropped on overflow / timeout.

Enums§

HostFrame
Phase CPD-1 (cross-process dispatch) — envelope enum for frames sent over the launcher → host pipe direction. Today the host’s read loop only expects Event JSON; CPD-2 extends the read loop to recognize this tagged union and dispatch by kind:
HostPipeError
Reasons send_command / send_event can fail synchronously.

Constants§

DISCONNECT_TIMEOUT
Maximum disconnect duration before the pending buffer is flushed. After this, every buffered Command’s saga is failed with "host unreachable". See spec §3.9.
PENDING_BUFFER_CAP
Maximum number of frames buffered while the host is disconnected. On overflow, the oldest frame is dropped; if it was a Command, Event::SagaFailed is emitted for the saga whose dispatch was lost. See spec §3.9.

Functions§

make_shared_writer
Wrap a boxed writer into a SharedWriter. Used by tests + ipc::server to coerce a concrete WriteHalf into the trait object the HostPipe stores.
saga_id_of 🔒
Pull the saga_id off a Command if its variant carries one.
write_frame_async 🔒
Serialize a HostFrame as newline-delimited JSON and write it to a writer. Used both for direct writes (connected) and for pending-buffer drain (post-reconnect).

Type Aliases§

BoxedWriter
Test-only convenience: own a Box directly. Tests construct one via make_shared_writer(Box::new(duplex_a)).
SharedWriter
Trait-object writer reference the HostPipe holds when connected.