eventbus

package module
v0.0.0-...-6b8e091 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2018 License: BSD-2-Clause Imports: 4 Imported by: 0

README

Eventbus

Package provide eventbus in Go

Usage

type TestEvent struct{}

eventBus := New()
eventBus.RegisterHandler(func(event TestEventA) {
  // handle event
})
eventBus.Publish(TestEventA{})

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() *eventBus

Types

type EventBus

type EventBus interface {
	RegisterHandler(fn interface{}) error
	UnregisterHandler(fn interface{}) error
	Publish(event interface{}) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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