mutex

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bus

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

The Bus allows publish-subscribe-style communication between components/modules

func NewBus

func NewBus() Bus

func NewBusPtr

func NewBusPtr() *Bus

func SharedBus

func SharedBus() *Bus

func (*Bus) Emit

func (e *Bus) Emit(topic string)

Send sends an event to all subscribed listeners. Parameter data is optional ; Send can only have one map parameter.

func (*Bus) EmitWithMessage

func (e *Bus) EmitWithMessage(topic string, data map[string]interface{})

EmitWithMessage sends an event to all subscribed listeners. Parameter data is optional ; EmitWithMessage can only have one map parameter.

func (*Bus) Shutdown

func (e *Bus) Shutdown()

wait to all messages to be processed

func (*Bus) Subscribe

func (e *Bus) Subscribe(topic string, listener gobus.EventListener)

Subscribe adds an EventListener to be called when an event is posted.

Jump to

Keyboard shortcuts

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