Documentation ¶
Index ¶
Constants ¶
View Source
const ( SUBSCRIBE cmd = iota SEND LEAVE SHUTDOWN INIT )
View Source
const TIMEOUT = time.Millisecond * 100
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventStream ¶
type EventStream[M any] struct { // FallbehindFn holds a function that is called when a subscriber falls behind // and isn't keeping up with SENDs FallbehindFn func(chan M, M) // contains filtered or unexported fields }
func NewEventStream ¶
func NewEventStream[M any](initial M) *EventStream[M]
func (*EventStream[M]) Leave ¶
func (es *EventStream[M]) Leave(ch chan M)
func (*EventStream[M]) Send ¶
func (es *EventStream[M]) Send(m M)
func (*EventStream[M]) Shutdown ¶
func (es *EventStream[M]) Shutdown()
func (*EventStream[M]) Sub ¶
func (es *EventStream[M]) Sub() chan M
Click to show internal directories.
Click to hide internal directories.