Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBrokerClosed = errors.New("Broker has been closed")
ErrBrokerClosed the broker has been closed
View Source
var ErrTimedTimedOut = errors.New("operation timed out")
ErrTimedTimedOut operation timed out
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
Broker represents the message broker.
func (*Broker) Counts ¶ added in v0.1.4
Counts returns the delivery count and dropped count respectively
type Config ¶ added in v1.0.0
type Config struct {
// DownStreamChanLen is the length of the channel used to send messages to the subscriber
DownStreamChanLen int
// PublishChanLen is the length of the incoming channel used by Publish()
PublishChanLen int
// SubscribeChanLen is the length of the channel that accepts Subscribe() requests
SubscribeChanLen int
// UnsubscribeChanLen is the length of the channel that accepts unsubscribe requests.
// This is used by the Cancel() call on Subscriber
UnsubscribeChanLen int
// DeliveryTimeout is the timeout before giving up delivering a message to a subscriber
DeliveryTimeout time.Duration
// Logger provides a logger for logging errors. Libraries shouldn't log so
// this is a compromise.
Logger Printfer
}
Config contains the broker configuration.
type Message ¶
type Message struct {
Topic string
Payload interface{}
}
Message contains the topic name the message was sent to and the payload.
type Printfer ¶ added in v1.0.2
type Printfer func(string, ...interface{})
Printfer is a Printf'er - that is, you can give it a function that looks like log.Printf.
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
Subscriber represents a subscription to a topic or topic prefix.
func (*Subscriber) Messages ¶
func (s *Subscriber) Messages() <-chan Message
Messages returns the message channel.
Click to show internal directories.
Click to hide internal directories.