Documentation
¶
Overview ¶
Package logstream is an in-memory pub/sub for recon-run logs, backing the SSE endpoint (ports.LogStream). Each run keeps a bounded replay buffer of recent lines so a reconnecting client (SSE Last-Event-ID) can resume without gaps, then tails live lines. It carries no business logic.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
Broker implements ports.LogStream.
func (*Broker) Close ¶
Close marks the run's stream ended: it emits a final Done event and closes every subscriber channel (so SSE handlers terminate). The replay buffer is kept so a late reconnect still gets the history + Done.
func (*Broker) Publish ¶
Publish appends a line to the run's stream and fans it out to live subscribers. A subscriber whose buffer is full is skipped for this live event (it remains in the replay buffer, so a reconnect recovers it) – the publisher never blocks.