event

package
v1.0.86 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: BSD-2-Clause Imports: 4 Imported by: 27

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DONE = Signal{}
View Source
var (
	NullEvent = &nullEvent{}
)

Functions

This section is empty.

Types

type Merger

type Merger struct {
	sync.Mutex
	Publisher
	// contains filtered or unexported fields
}

func (*Merger) Close

func (this *Merger) Close()

func (*Merger) Merge

func (this *Merger) Merge(publisher gopi.Publisher)

func (*Merger) Unmerge

func (this *Merger) Unmerge(publisher gopi.Publisher)

type Publisher

type Publisher struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*Publisher) Close

func (this *Publisher) Close()

Close will unsubscribe all remaining channels

func (*Publisher) Emit

func (this *Publisher) Emit(evt gopi.Event)

Emit an event onto all subscriber channels, this method will block if the subscribers are not processing incoming events

func (*Publisher) Subscribe

func (this *Publisher) Subscribe() <-chan gopi.Event

Subscribe returns a new channel on which emitting events can occur

func (*Publisher) Unsubscribe

func (this *Publisher) Unsubscribe(subscriber <-chan gopi.Event)

Unsubscribe closes a channel and removes it from the list of channels which emitting can happen on

type Signal added in v1.0.20

type Signal struct{}

type TaskFunc added in v1.0.20

type TaskFunc func(start chan<- Signal, stop <-chan Signal) error

type Tasks added in v1.0.20

type Tasks struct {
	sync.WaitGroup
	// contains filtered or unexported fields
}

func (*Tasks) Close added in v1.0.20

func (this *Tasks) Close() error

Close sends done signals to each go routine and will return any error from the tasks. Each go routine may end before the 'stop' signal is returned...

func (*Tasks) Start added in v1.0.20

func (this *Tasks) Start(funcs ...TaskFunc)

Start tasks in the background and waits for all "start" signals to be returned before unblocking

Jump to

Keyboard shortcuts

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