Skip to main content

Module Multiplexer

Module Multiplexer 

Source
Expand description

Bidirectional streaming multiplexer for the Vine gRPC bus.

Owns one bidirectional h2 stream per sidecar. Inbound notifications fan out to the process-wide broadcast (Vine::Client::SubscribeNotifications); inbound responses route to the matching pending-request oneshot sender. Inbound reverse-RPC requests and cancellations are TODO for a follow-up phase.

This is the P14.1 foundation of Patch 14 - it lands the open(), Notify(), Request(), and ReadPump skeleton so subsequent phases can wire SendNotification / SendRequest to consult the multiplexer when LAND_VINE_STREAMING=1 is set.

Structsยง

MULTIPLEXERS ๐Ÿ”’
Process-wide registry, one entry per sidecar identifier. Lookup site for SendNotification / SendRequest to consult when LAND_VINE_STREAMING=1.
Multiplexer
One multiplexer per sidecar connection. Holds the outbound sink, the pending-request correlation map, and a shared-state shutdown flag.

Constantsยง

SINK_CAPACITY ๐Ÿ”’
Outbound queue capacity per multiplexer. Bounded so a stalled sidecar applies backpressure to the producer side instead of burning unbounded heap.

Functionsยง

ReadPump ๐Ÿ”’
Drain the inbound side of the bidirectional stream. Notifications fan out to the process-wide broadcast; responses wake the parked Request future. Reverse-RPC requests and cancellations are recorded for a follow-up phase.