hub

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Emit

func Emit(e Eventer) (errs map[ListenerName]error)

func EventName

func EventName(e Eventer) string

func Make

func Make(e Eventer)

func On

func On(listenerName ListenerName)

func Register

func Register(l Listener)

Register register Listener to hub

func RegisterQueue

func RegisterQueue()

Types

type Event

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

func (*Event) ParamProto

func (e *Event) ParamProto() proto.Message

func (*Event) SetParam

func (e *Event) SetParam(paramPtr proto.Message)

type Eventer

type Eventer interface {
	SetParam(paramPtr proto.Message)

	ParamProto() proto.Message
	// contains filtered or unexported methods
}

type EventerName

type EventerName = string

type Listen

type Listen struct {
}

func (*Listen) Construct

func (l *Listen) Construct(paramPtr proto.Message) error

func (*Listen) Delay

func (l *Listen) Delay() zone.Duration

func (*Listen) Handle

func (l *Listen) Handle() error

func (*Listen) Name

func (l *Listen) Name() ListenerName

func (*Listen) Retries

func (l *Listen) Retries() uint32

func (*Listen) Subscribe

func (l *Listen) Subscribe() (eventPtrList []Eventer)

type Listener

type Listener interface {
	Name() ListenerName
	Subscribe() (eventPtrList []Eventer)

	Construct(paramPtr proto.Message) error
	Handle() error

	Retries() uint32
	Delay() zone.Duration
}

type ListenerName

type ListenerName = string

Jump to

Keyboard shortcuts

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