Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Binary ¶ added in v0.1.4
type Binary []byte
Binary - Actual message content to be published
type Message ¶
Message - Publisher showing intent of publishing arbitrary byte slice to topics
type PubSub ¶
type PubSub struct {
Alive bool
// contains filtered or unexported fields
}
PubSub - Pub/Sub Server i.e. holds which clients are subscribed to what topics, manages publishing messages to correct topics, handles (un-)subscription requests
In other words state manager of Pub/Sub Broker
func (*PubSub) Publish ¶
Publish - Send message publishing request to N-topics in concurrent-safe manner
type PublishedMessage ¶
PublishedMessage - Subscriber will receive message for consumption in this form
type String ¶ added in v0.1.4
type String string
String - Message topic to be written into stream in this form
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
Subscriber - Uniquely identifiable subscriber with multiple subscribed topics from where it wishes to listen from over ping channel
func (*Subscriber) AddSubscription ¶
func (s *Subscriber) AddSubscription(topics ...string) (bool, uint64)
AddSubscription - Add subscriptions to more topics on-the-fly
func (*Subscriber) Next ¶
func (s *Subscriber) Next() *PublishedMessage
Next - Attempt to consume oldest message living in buffer, by popping it out, in concurrent-safe manner
func (*Subscriber) Unsubscribe ¶
func (s *Subscriber) Unsubscribe(topics ...string) (bool, uint64)
Unsubscribe - Unsubscribe from specified subscribed topics
func (*Subscriber) UnsubscribeAll ¶
func (s *Subscriber) UnsubscribeAll() (bool, uint64)
UnsubscribeAll - Unsubscribe from all active subscribed topics

