Documentation
¶
Overview ¶
Package broadcast provides a lock-free Single-Producer Multi-Consumer (SPMC) ring buffer for broadcasting state snapshots without blocking the producer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Topic ¶
type Topic[T any] struct { // contains filtered or unexported fields }
Topic is a lock-free, SPMC ring buffer. Producer writes sequentially; consumers maintain private cursors.
func (*Topic[T]) Publish ¶
func (t *Topic[T]) Publish(msg T)
Publish stores a message and increments the sequence. Concurrency: strictly single-producer.
Click to show internal directories.
Click to hide internal directories.