Documentation ¶
Index ¶
- type Message
- type ServiceBus
- func (s *ServiceBus) Debug()
- func (s *ServiceBus) Publish(topic string, data interface{})
- func (s *ServiceBus) PublishForTarget(topic string, data interface{}, target string)
- func (s *ServiceBus) Start() error
- func (s *ServiceBus) Stop() error
- func (s *ServiceBus) Subscribe(topic string) (<-chan *Message, error)
- func (s *ServiceBus) UnSubscribe(topic string)
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 ¶
NewMessage creates a new message with the given topic and data
func NewMessageForTarget ¶
NewMessageForTarget creates a new message with the given topic and data
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) 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) 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!)