Skip to content

Stream Events

Implementation file: peer_stream_event.go

DocumentationFeatures included
peer_stream_event.goMaintain the Peer event subscriber/broadcast broker; convert bidirectionally between PeerStreamEvent and GenX message chunks; process text, control, and blob/audio events; broadcast Agent output events and push received events back to the Agent input source.

This prefix holds the product mapping for the GizClaw Peer event stream. The underlying stream transport belongs to pkgs/giznet; domain state changes are still owned by the service that generated the event.

Core structure and main function

SymbolFunction
peerStreamEventBrokerManage event stream subscribers and broadcast product events.
peerAgentOutputConsume Agent output, broadcast events, and pass audio to MixerOutput.
readPeerStreamEvent / writePeerStreamEventDecode and encode Peer stream events.
peerStreamEventToChunkConvert product events into GenX message chunks.
peerStreamEventsFromChunkExpand a GenX chunk into one or more product events.
pushAgentChunkPush the received event chunk into the Agent input source.

Downlink audio has no raw Direct Opus branch. MixerOutput owns one decoder and PCM track per (StreamID, canonical MIME) key. MIME EOS closes only the matching track, while control-only EOS closes every track on that route. Normal EOS uses CloseWrite to drain buffered PCM; error EOS uses CloseWithError to discard the matching track buffer.