events

package
v0.0.0-...-c2e30b8 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: NIST-PD-fallback Imports: 2 Imported by: 1

Documentation

Overview

Package events provides a simple event emitter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Emitter

type Emitter struct {
	*emission.Emitter
}

Emitter is a simple event emitter. This is a thin wrapper of emission.Emitter that modifies emitter.On method to return an io.Closer that cancels the callback registration.

func NewEmitter

func NewEmitter() *Emitter

NewEmitter creates a simple event emitter.

func (*Emitter) On

func (emitter *Emitter) On(event, listener interface{}) io.Closer

On registers a callback when an event occurs. Returns an io.Closer that cancels the callback registration.

Jump to

Keyboard shortcuts

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