Documentation ¶
Index ¶
- type Bus
- func (bus *Bus) Publish(topic string, ev Event)
- func (bus *Bus) PublishArgs(topic string, args ...interface{})
- func (bus *Bus) Start() error
- func (bus *Bus) Stop()
- func (bus *Bus) Subscribe(topic string, ch interface{}) error
- func (bus *Bus) SubscribeAsync(topic string, fn interface{}, transactional bool) error
- func (bus *Bus) SubscribeEventChan(topic string, ch EventChan) error
- func (bus *Bus) SubscribeOnce(topic string, fn interface{}) error
- func (bus *Bus) SubscribeOnceAsync(topic string, fn interface{}) error
- func (bus *Bus) UnSubscribe(topic string, ch interface{})
- func (bus *Bus) Wait()
- type Event
- type EventChan
- type Publisher
- type Subscriber
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
}
func (*Bus) PublishArgs ¶ added in v1.5.8
func (*Bus) SubscribeAsync ¶ added in v1.5.8
func (*Bus) SubscribeEventChan ¶ added in v1.5.8
func (*Bus) SubscribeOnce ¶ added in v1.5.8
SubscribeOnce subscribes to a topic once. Handler will be removed after executing. Returns error if `fn` is not a function.
func (*Bus) SubscribeOnceAsync ¶ added in v1.5.8
SubscribeOnceAsync subscribes to a topic once with an asynchronous callback Async determines whether subsequent Publish should wait for callback return Handler will be removed after executing. Returns error if `fn` is not a function.
func (*Bus) UnSubscribe ¶
type Subscriber ¶
type Subscriber interface { SubscribeEventChan(topic string, ch EventChan) error Subscribe(topic string, ch interface{}) error SubscribeAsync(topic string, ch interface{}, transactional bool) error SubscribeOnce(topic string, ch interface{}) error SubscribeOnceAsync(topic string, ch interface{}) error UnSubscribe(topic string, ch interface{}) }
Subscriber ch is func or chan.(EventChan)
Click to show internal directories.
Click to hide internal directories.