eventemitter

package
v1.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2026 License: GPL-3.0 Imports: 1 Imported by: 0

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)

type Receiver

type Receiver[T any] interface {
	Subscribe() chan T
	Unsubscribe(ch chan T)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL