eventbus

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Publish

func Publish(event string, args ...interface{})

func Subscribe

func Subscribe(event string, fn Handler)

func Unsubscribe

func Unsubscribe(event string, fn Handler) bool

func UnsubscribeAll

func UnsubscribeAll(event string)

func WaitAll

func WaitAll()

Types

type EventBus

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

func New

func New() *EventBus

func (*EventBus) Publish

func (bus *EventBus) Publish(event string, args ...interface{})

func (*EventBus) Subscribe

func (bus *EventBus) Subscribe(event string, fn Handler) error

func (*EventBus) Unsubscribe

func (bus *EventBus) Unsubscribe(event string, fn Handler) bool

func (*EventBus) UnsubscribeAll

func (bus *EventBus) UnsubscribeAll(event string)

func (*EventBus) WaitAll

func (bus *EventBus) WaitAll()

type Handler

type Handler func(event string, time time.Time, args ...interface{})

Jump to

Keyboard shortcuts

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