async fn send_event_shared(
writer: &Arc<Mutex<Box<dyn AsyncWrite + Unpin + Send>>>,
event: Event,
) -> Result<()>Expand description
Serialize an Event as one JSON line + \n and write atomically
(under the per-connection writer mutex). Returns Err if the
connection died mid-write.
CPD-2 — generalized from Arc<Mutex<WriteHalf<NamedPipeServer>>>
to crate::host_pipe::SharedWriter so the launcher’s IPC server
- the host_pipe wrapper share one writer-handle representation.
Wire shape is unchanged: a non-host client sees a raw
EventJSON line (legacy schema), a host client sees aHostFrame::Eventenvelope only when the frame goes throughHostPipe::send_event. Connection-private error replies in this file still emit rawEventJSON to preserve backwards compat with existing host versions that haven’t adopted the envelope yet — CPD-1 lands the host-side schema migration.