Versions in this module Expand all Collapse all v4 v4.1.0 Nov 25, 2022 Changes in this version + type CallbackFunc func(topic string, data interface{}) + type Event struct + Data interface{} + Topic string + func (e *Event) Done() + type EventBus struct + func NewEventBus() *EventBus + func (eb *EventBus) HasSubscribers(topic string) bool + func (eb *EventBus) Publish(topic string, data interface{}) interface{} + func (eb *EventBus) PublishAsync(topic string, data interface{}) + func (eb *EventBus) PublishAsyncOnce(topic string, data interface{}) + func (eb *EventBus) PublishOnce(topic string, data interface{}) interface{} + func (eb *EventBus) Stats() *Stats + func (eb *EventBus) Subscribe(topic string) (EventChannel, *Subscription) + func (eb *EventBus) SubscribeCallback(topic string, callable CallbackFunc) *Subscription + func (eb *EventBus) SubscribeChannel(topic string, ch EventChannel) *Subscription + type EventChannel chan Event + func NewEventChannel() EventChannel + type SafeCounter struct + func NewSafeCounter() *SafeCounter + func (c *SafeCounter) Dec() + func (c *SafeCounter) DecBy(dec uint) + func (c *SafeCounter) Inc() + func (c *SafeCounter) IncBy(add uint) + func (c *SafeCounter) Value() int + type Stats struct + func (s *Stats) GetPublishedCountByTopic(topicName string) int + func (s *Stats) GetSubscriberCountByTopic(topicName string) int + func (s *Stats) GetTopicStats() []*TopicStats + func (s *Stats) GetTopicStatsByName(topicName string) *TopicStats + type Subscription struct + func NewSubscription() *Subscription + func (it *Subscription) Close() + func (it *Subscription) OnClose(fn func()) + type TopicStats struct + Name string + PublishedCount *SafeCounter + SubscriberCount *SafeCounter