Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventQueue ¶
type EventQueue[T any] struct { // contains filtered or unexported fields }
func New ¶
func New[T any](discardAfter time.Duration, discardFn func(T)) EventQueue[T]
New provides a queue for sending messages to one or more subscribers. Messages are held for the given discardAfter duration if there are no subscribers.
func (*EventQueue[T]) Send ¶
func (eq *EventQueue[T]) Send(event T)
func (*EventQueue[T]) Shutdown ¶
func (eq *EventQueue[T]) Shutdown()
func (*EventQueue[T]) Subscribe ¶
func (eq *EventQueue[T]) Subscribe() (<-chan T, io.Closer)
Click to show internal directories.
Click to hide internal directories.