Documentation ¶
Overview ¶
events defines an event subscriber and dispatcher
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmitterInterface ¶
type EmitterInterface interface { // Emit Sends an event to the subscribed listeners Emit(context.Context, Event) // GlobalChannel returns a glocal channel that receives emitted events GlobalChannel(ctx context.Context) <-chan Event // Subscribe Returns a channel that receives emitted events Subscribe(context.Context) <-chan Event // UnsubscribeAll close all listeners channels UnsubscribeAll() }
EmitterInterface Root interface for events dispatch
type EventEmitter ¶
type EventEmitter struct {
// contains filtered or unexported fields
}
EventEmitter Registers listeners and dispatches events to them
func (*EventEmitter) GlobalChannel ¶ added in v1.14.1
func (e *EventEmitter) GlobalChannel(ctx context.Context) <-chan Event
func (*EventEmitter) UnsubscribeAll ¶
func (e *EventEmitter) UnsubscribeAll()
Click to show internal directories.
Click to hide internal directories.