Documentation
¶
Index ¶
- type MsgBus
- func (m *MsgBus) Broadcast(id uint64, v interface{})
- func (m *MsgBus) BroadcastToAll(v interface{})
- func (m *MsgBus) Close() error
- func (m *MsgBus) Subscribe(id uint64) *Subscription
- func (m *MsgBus) SubscribeBuffered(id uint64, n int) *Subscription
- func (m *MsgBus) SubscribeOnce(id uint64) *Subscription
- type Subscription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MsgBus ¶
type MsgBus struct {
// contains filtered or unexported fields
}
MsgBus is a 1-to-n event distribution.
func (*MsgBus) BroadcastToAll ¶
func (m *MsgBus) BroadcastToAll(v interface{})
BroadcastToAll sends v to all events subscribers.
func (*MsgBus) Subscribe ¶
func (m *MsgBus) Subscribe(id uint64) *Subscription
Subscribe creates an async subscription for event.
func (*MsgBus) SubscribeBuffered ¶
func (m *MsgBus) SubscribeBuffered(id uint64, n int) *Subscription
SubscribeBuffered creates an async buffered subscription for event.
func (*MsgBus) SubscribeOnce ¶
func (m *MsgBus) SubscribeOnce(id uint64) *Subscription
SubscribeOnce creates an async one time subscription for event.
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
Subscription represents interest in a given event.
func (*Subscription) Chan ¶
func (s *Subscription) Chan() <-chan interface{}
Chan returns subscription channel.
func (*Subscription) Unsubscribe ¶
func (s *Subscription) Unsubscribe()
Unsubscribe will remove interest in the given event.
Click to show internal directories.
Click to hide internal directories.