Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockingEventEmitter ¶
type BlockingEventEmitter[T any] struct { EventEmitter[T] }
func (*BlockingEventEmitter[T]) Emit ¶
func (e *BlockingEventEmitter[T]) Emit(event T)
type EventEmitter ¶
type EventEmitter[T any] struct { DefaultCapacity int // default capacity for channels, can be set to avoid blocking // contains filtered or unexported fields }
EventEmitter emits events to subscribers, events can be dropped if subscribers are not ready to receive them.
func (*EventEmitter[T]) Clear ¶
func (e *EventEmitter[T]) Clear()
func (*EventEmitter[T]) Emit ¶
func (e *EventEmitter[T]) Emit(event T)
func (*EventEmitter[T]) Subscribe ¶
func (e *EventEmitter[T]) Subscribe() chan T
func (*EventEmitter[T]) Unsubscribe ¶
func (e *EventEmitter[T]) Unsubscribe(ch chan T)
Click to show internal directories.
Click to hide internal directories.