listenerswitch

package
v0.0.0-...-157c9c8 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrRegisterMuxHandler = lerr.Str("handler argument to RegisterMuxHandler requires a func or a channel")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ListenerSwitch

type ListenerSwitch struct {
	*handler.Switch
	lerr.ErrHandler
	// contains filtered or unexported fields
}

ListenerSwitch takes objects off a channel and passes them into the handlers for that type.

func New

func New(size int, in <-chan any, errHandler any, handlers ...any) (*ListenerSwitch, error)

New creates a ListenerSwitch for the in bus channel.

func (*ListenerSwitch) Handle

func (ls *ListenerSwitch) Handle(i any) (any, error)

func (*ListenerSwitch) Run

func (ls *ListenerSwitch) Run()

Run the ListenerSwitch. It will stop running when the channel is closed.

func (*ListenerSwitch) SetErrorHandler

func (ls *ListenerSwitch) SetErrorHandler(i any) (err error)

func (*ListenerSwitch) SetIn

func (ls *ListenerSwitch) SetIn(in <-chan interface{})

SetIn sets the interface channel the ListerMux is listening on.

Jump to

Keyboard shortcuts

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