eventbroker

package
v0.0.0-...-cb9b391 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2020 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker struct {
	Quit          chan struct{}
	Subscriptions map[*Subscription]struct{}
	Register      chan *Subscription
	Unregister    chan *Subscription
	MessageQueue  chan *Message
	EventHook     func(status int)
	// contains filtered or unexported fields
}

func (*Broker) Broadcast

func (b *Broker) Broadcast(msg *Message)

func (*Broker) Close

func (b *Broker) Close()

func (*Broker) CountSubs

func (b *Broker) CountSubs() int

func (*Broker) Publish

func (b *Broker) Publish(msgType string, msgValue string)

func (*Broker) Run

func (b *Broker) Run()

func (*Broker) Subscribe

func (b *Broker) Subscribe() *Subscription

func (*Broker) WaitForClose

func (b *Broker) WaitForClose(sub *Subscription)

type Message

type Message struct {
	Type  string
	Value string
}

type Subscription

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

func (*Subscription) Close

func (c *Subscription) Close()

func (*Subscription) Inject

func (c *Subscription) Inject(msgType string, msgValue string)

Inject a message into the incoming channel

func (*Subscription) Next

func (c *Subscription) Next() <-chan *Message

Jump to

Keyboard shortcuts

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