events

package
v1.22.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

events defines an event subscriber and dispatcher Deprecated: use EventBus instead

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmitterInterface

type EmitterInterface interface {
	// Deprecated: Emit Sends an event to the subscribed listeners
	Emit(context.Context, Event)

	// Deprecated: GlobalChannel returns a glocal channel that receives emitted events
	GlobalChannel(ctx context.Context) <-chan Event

	// Deprecated: Subscribe Returns a channel that receives emitted events
	Subscribe(ctx context.Context) <-chan Event

	// Deprecated: UnsubscribeAll close all listeners channels
	UnsubscribeAll()
}

EmitterInterface Root interface for events dispatch

type Event

type Event interface{}

type EventEmitter deprecated

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

Deprecated: use event bus directly EventEmitter Registers listeners and dispatches events to them

func (*EventEmitter) Emit deprecated

func (e *EventEmitter) Emit(_ context.Context, evt Event)

Deprecated: use event bus directly Emit Sends an event to the subscribed listeners

func (*EventEmitter) GetBus

func (e *EventEmitter) GetBus() (bus event.Bus)

func (*EventEmitter) GlobalChannel deprecated

func (e *EventEmitter) GlobalChannel(ctx context.Context) (cc <-chan Event)

Deprecated: use event bus directly GlobalChannel returns a glocal channel that receives emitted events

func (*EventEmitter) SetBus

func (e *EventEmitter) SetBus(bus event.Bus) (err error)

set event bus, return an error if the bus is already set

func (*EventEmitter) Subscribe deprecated

func (e *EventEmitter) Subscribe(ctx context.Context) <-chan Event

Deprecated: use event Bus directly Subscribe Returns a channel that receives emitted events

func (*EventEmitter) UnsubscribeAll deprecated

func (e *EventEmitter) UnsubscribeAll()

Deprecated: use event bus directly UnsubscribeAll close all listeners channels

Jump to

Keyboard shortcuts

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