Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker interface {
// Publish publishes a message to a topic.
// The message is delivered to all subscribers of the topic.
Publish(topic string, msg interface{})
// Subscribe subscribes to a topic.
// The handler is called for each message published to the topic.
// The returned Subscription can be used to unsubscribe from the topic.
Subscribe(topic string, handler func(interface{})) Subscription
}
Broker handles topics, subscriptions and message delivery.
type Subscription ¶
type Subscription interface {
// Unsubscribe unsubscribes from a topic.
Unsubscribe()
}
Subscription handles unsubscribing from a topic.
Click to show internal directories.
Click to hide internal directories.