listener

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Listener

type Listener struct {
	bus.Receiver
	bus.ListenerSwitcher
	// contains filtered or unexported fields
}

func FromMux

func FromMux(r bus.Receiver, lm bus.ListenerSwitcher, handlers ...interface{}) (*Listener, error)

New creates a Listener from a Receiver and a ListenerSwitcher. It connects the Out channel on the Receiver to the In channel on the ListenerSwitcher. If ListenerSwitcher is nil, one will be created. If errHandler is not nil it will be set on both the Receiver and ListenerSwitcher.

func New

func New(muxSize int, r bus.Receiver, errHandler any, handlers ...interface{}) (*Listener, error)

func (*Listener) RegisterHandlers

func (l *Listener) RegisterHandlers(handlers ...any) error

RegisterHandler with the underlying ListenerSwitcher and the argument to the handler is registered with the Receiver.

func (*Listener) Run

func (l *Listener) Run()

Run both the Receiver and the ListenerSwitcher.

func (*Listener) SetErrorHandler

func (l *Listener) SetErrorHandler(errHandler any) error

SetErrorHandler on both the underlying ListenerSwitcher and Receiver.

func (*Listener) SetOut

func (l *Listener) SetOut(out chan<- any)

Jump to

Keyboard shortcuts

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