bus

package
v0.0.1-test Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: AGPL-3.0 Imports: 6 Imported by: 3,405

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrHandlerNotFound = errors.New("handler not found")

ErrHandlerNotFound defines an error if a handler is not found

Functions

This section is empty.

Types

type Bus

type Bus interface {
	Publish(ctx context.Context, msg Msg) error
	AddEventListener(handler HandlerFunc)
}

Bus type defines the bus interface structure

type HandlerFunc

type HandlerFunc interface{}

HandlerFunc defines a handler function interface.

type InProcBus

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

InProcBus defines the bus structure

func ProvideBus

func ProvideBus(tracer tracing.Tracer) *InProcBus

func (*InProcBus) AddEventListener

func (b *InProcBus) AddEventListener(handler HandlerFunc)

func (*InProcBus) Publish

func (b *InProcBus) Publish(ctx context.Context, msg Msg) error

PublishCtx function publish a message to the bus listener.

type Msg

type Msg interface{}

Msg defines a message interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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