listeners

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MsgChanSize is the buffer size of the message channel
	MsgChanSize = 128
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container interface {
	// Register registers a new listener and returns a function for de-registration
	Register(l *Listener) func()
	// GetListeners returns all active listeners
	GetListeners(msgType network.NetworkMsg) []*Listener
}

Container is an interface for managing internal listeners

func NewListenersContainer

func NewListenersContainer(ctx context.Context, logger *zap.Logger) Container

NewListenersContainer creates a new instance of listeners container

type Listener

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

Listener represents an internal listener

func NewListener

func NewListener(msgType network.NetworkMsg) *Listener

NewListener creates a new instance of listener

func (*Listener) DecidedChan

func (l *Listener) DecidedChan() chan *proto.SignedMessage

DecidedChan returns the underlying decided channel

func (*Listener) MsgChan

func (l *Listener) MsgChan() chan *proto.SignedMessage

MsgChan returns the underlying msg channel

func (*Listener) SigChan

func (l *Listener) SigChan() chan *proto.SignedMessage

SigChan returns the underlying signature channel

func (*Listener) SyncChan

func (l *Listener) SyncChan() chan *network.SyncChanObj

SyncChan returns the underlying sync channel

Jump to

Keyboard shortcuts

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