servicebus

package
v2.0.0-alpha.61 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

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

Message is a service bus message that contains a topic and data

func NewMessage

func NewMessage(topic string, data interface{}) *Message

NewMessage creates a new message with the given topic and data

func NewMessageForTarget

func NewMessageForTarget(topic string, data interface{}, target string) *Message

NewMessageForTarget creates a new message with the given topic and data

func (*Message) Data

func (m *Message) Data() interface{}

Data returns the message data

func (*Message) Target

func (m *Message) Target() string

Target returns the message Target

func (*Message) Topic

func (m *Message) Topic() string

Topic returns the message topic

type ServiceBus

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

ServiceBus is a messaging bus for Wails applications

func New

func New(logger *logger.Logger) *ServiceBus

New creates a new ServiceBus The internal message queue is set to 100 messages Listener queues are set to 10

func (*ServiceBus) Debug

func (s *ServiceBus) Debug()

Debug puts the service bus into debug mode.

func (*ServiceBus) Publish

func (s *ServiceBus) Publish(topic string, data interface{})

Publish sends the given message on the service bus

func (*ServiceBus) PublishForTarget

func (s *ServiceBus) PublishForTarget(topic string, data interface{}, target string)

PublishForTarget sends the given message on the service bus for the given target

func (*ServiceBus) Start

func (s *ServiceBus) Start() error

Start the service bus

func (*ServiceBus) Stop

func (s *ServiceBus) Stop() error

Stop the service bus

func (*ServiceBus) Subscribe

func (s *ServiceBus) Subscribe(topic string) (<-chan *Message, error)

Subscribe is used to register a listener's interest in a topic

func (*ServiceBus) UnSubscribe

func (s *ServiceBus) UnSubscribe(topic string)

UnSubscribe removes the listeners for the given topic (Use with caution!)

Jump to

Keyboard shortcuts

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