Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultQueueSize = 16
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Emitter ¶
type Emitter[K comparable, V any] struct { // contains filtered or unexported fields }
func NewEmitter ¶
func NewEmitter[K comparable, V any](opts ...Option) *Emitter[K, V]
func (*Emitter[K, V]) ObservedKeys ¶
func (e *Emitter[K, V]) ObservedKeys() []K
type Observer ¶
type Observer[V any] interface { Stop() Events() <-chan V // contains filtered or unexported methods }
func NewObserver ¶
type ObserverList ¶
type ObserverList[V any] struct { // contains filtered or unexported fields }
func NewObserverList ¶
func NewObserverList[V any](opts ...Option) *ObserverList[V]
func (*ObserverList[V]) Emit ¶
func (l *ObserverList[V]) Emit(v V)
func (*ObserverList[V]) Len ¶
func (l *ObserverList[V]) Len() int
func (*ObserverList[V]) Notify ¶
func (l *ObserverList[V]) Notify(ch chan V) func()
func (*ObserverList[V]) Observe ¶
func (l *ObserverList[V]) Observe() Observer[V]
func (*ObserverList[V]) On ¶
func (l *ObserverList[V]) On(f func(V)) func()
type Option ¶
type Option func(o *Options)
func WithBlocking ¶
func WithBlocking() Option
func WithLogger ¶
func WithOptions ¶
func WithQueueSize ¶
Click to show internal directories.
Click to hide internal directories.