concurrent

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: May 2, 2021 License: AGPL-3.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSignallerRetired = fmt.Errorf("Signaller retiered")
	ErrUnknownListener  = fmt.Errorf("Unknown signal listener")
)

Error codes

View Source
var (
	LISTENER_ADD  = 0
	LISTENER_DROP = 1
)

ListenerOp codes

Functions

This section is empty.

Types

type ListenerOp

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

ListenerOp represents an operation on the listener list:

type Signal

type Signal interface{}

Signal can be any object (intrinsic or custom); it is the responsibility of the senders and receivers of signals to handle them accordingly.

type Signaller

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

Signaller manages signals send by senders for multiple listeners.

func NewSignaller

func NewSignaller() *Signaller

NewSignaller instantiates a new signal manager:

func (*Signaller) Drop

func (s *Signaller) Drop(out chan Signal) error

Drop removes a listener from the list.

func (*Signaller) Listen

func (s *Signaller) Listen() chan Signal

Listen returns a channel to listen on

func (*Signaller) Retire

func (s *Signaller) Retire()

Retire a signaller: This will terminate the dispatch loop for signals; no further send or listen operations are supported. A retired signaller cannot be re-activated.

func (*Signaller) Send

func (s *Signaller) Send(sig Signal) error

Send a signal to be dispatched to all listeners.

Jump to

Keyboard shortcuts

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