Documentation
¶
Index ¶
- type Broker
- func (b *Broker[ChannelT, MsgT]) Close()
- func (b *Broker[ChannelT, MsgT]) Publish(channel ChannelT, msg MsgT)
- func (b *Broker[ChannelT, MsgT]) Start()
- func (b *Broker[ChannelT, MsgT]) Subscribe(channel ChannelT) chan MsgT
- func (b *Broker[ChannelT, MsgT]) Unsubscribe(channel ChannelT, msgCh chan MsgT)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker[ChannelT comparable, MsgT any] struct { // contains filtered or unexported fields }
Broker is a message broadcaster to multiple subscribers (channels).
func NewBroker ¶
func NewBroker[ChannelT comparable, MsgT any]() *Broker[ChannelT, MsgT]
NewBroker creates a new Broker.
func (*Broker[ChannelT, MsgT]) Close ¶
func (b *Broker[ChannelT, MsgT]) Close()
Close stops the broker.
func (*Broker[ChannelT, MsgT]) Publish ¶
func (b *Broker[ChannelT, MsgT]) Publish(channel ChannelT, msg MsgT)
Publish publishes a message to the broker.
func (*Broker[ChannelT, MsgT]) Start ¶
func (b *Broker[ChannelT, MsgT]) Start()
Start starts the broker.
Source Files
¶
- broker.go
Click to show internal directories.
Click to hide internal directories.