Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
Publisher is basic pub/sub structure. Allows to send events and subscribe to them. Can be safely used from multiple goroutines.
func NewPublisher ¶
NewPublisher creates a new pub/sub publisher to broadcast messages. The duration is used as the send timeout as to not block the publisher publishing messages to other clients if one client is slow or unresponsive. The buffer is used when creating new channels for subscribers.
func (*Publisher) Close ¶
func (p *Publisher) Close()
Close closes the channels to all subscribers registered with the publisher.
func (*Publisher) Evict ¶
func (p *Publisher) Evict(sub chan interface{})
Evict removes the specified subscriber from receiving any more messages.
Click to show internal directories.
Click to hide internal directories.