eventemitter

package
v0.0.0-...-6470968 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenEventID

func GenEventID() eventID

Types

type Event

type Event struct {
	Signal eventID
	Data   interface{}
}

func (Event) String

func (e Event) String() string

type EventEmitter

type EventEmitter interface {
	AddEvent(eventID eventID, f eventFunc)
	EmitEvent(eventID eventID, data interface{}) error
}

func NewEventEmitter

func NewEventEmitter(ctx context.Context, size int, logger logger.Logger) EventEmitter

type EventEmitterImpl

type EventEmitterImpl struct {
	// contains filtered or unexported fields
}

func (*EventEmitterImpl) AddEvent

func (m *EventEmitterImpl) AddEvent(eventID eventID, f eventFunc)

func (*EventEmitterImpl) Close

func (m *EventEmitterImpl) Close()

func (*EventEmitterImpl) EmitEvent

func (m *EventEmitterImpl) EmitEvent(eventID eventID, data interface{}) error

func (*EventEmitterImpl) Remove

func (m *EventEmitterImpl) Remove(eventID eventID)

func (*EventEmitterImpl) SyncEmitEvent

func (m *EventEmitterImpl) SyncEmitEvent(eventID eventID, data interface{}) error

Jump to

Keyboard shortcuts

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