listener

package
v2.4.8 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Example
eventListener := New()

ch := make(chan string)
eventListener.Add("eventname", ch)
for eventdata := range ch {
	fmt.Println(eventdata + " world")
}

eventListener.Emit("eventname", "hello")
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Listener

type Listener interface {
	SetLimit(eventName string, limit time.Duration)
	ProvideChannel(eventName string) <-chan string
	Add(eventName string, channel chan<- string)
	Remove(eventName string, channel chan<- string)
	Emit(eventName string, data string)
	SetBuffer(eventName string)
	RetryEmit(eventName string)
	Book(eventName string)
}

Listener has a list of channels watching for updates.

func New

func New() Listener

New returns a new Listener which initially has no topics.

Jump to

Keyboard shortcuts

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