events

package
v0.0.0-...-80caa2b Latest Latest
Warning

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

Go to latest
Published: May 2, 2022 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DispatcherCapacity     = 20
	DefaultDispatchTimeout = 10 * time.Second
	HandlerCapacity        = 10
)

Functions

func MakeHandler

func MakeHandler[E any]() chan E

Types

type Dispatcher

type Dispatcher struct {
	DispatchTimeout time.Duration
	// contains filtered or unexported fields
}

func NewDispatcher

func NewDispatcher() *Dispatcher

func (*Dispatcher) Dispatch

func (d *Dispatcher) Dispatch(event any)

func (*Dispatcher) GoString

func (d *Dispatcher) GoString() string

func (*Dispatcher) String

func (d *Dispatcher) String() string

func (*Dispatcher) Subscribe

func (d *Dispatcher) Subscribe(handler interface{}) *Subscription

type Done

type Done <-chan struct{}

type Subscription

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

func (*Subscription) Apply

func (s *Subscription) Apply()

func (*Subscription) Cancel

func (s *Subscription) Cancel()

Jump to

Keyboard shortcuts

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