Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PubSub ¶
type PubSub struct {
// contains filtered or unexported fields
}
PubSub is a structure to support event publishing/subscription. TODO: Temporary Memory PubSub.
- We will need to replace this with distributed pubSub.
func (*PubSub) Subscribe ¶
func (m *PubSub) Subscribe( subscriber *time.ActorID, topics []string, ) (*Subscription, map[string][]string, error)
Subscribe subscribes to the given topics.
func (*PubSub) Unsubscribe ¶
func (m *PubSub) Unsubscribe(topics []string, sub *Subscription)
Unsubscribe unsubscribes the given topics.
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
Subscription represents the subscription of a subscriber. It is used across several topics.
func (*Subscription) Close ¶
func (s *Subscription) Close()
Close closes all resources of this Subscription.
func (*Subscription) Events ¶
func (s *Subscription) Events() <-chan DocEvent
Events returns the DocEvent channel of this subscription.
func (*Subscription) Subscriber ¶
func (s *Subscription) Subscriber() *time.ActorID
Subscriber returns the subscriber of this subscription.
func (*Subscription) SubscriberID ¶
func (s *Subscription) SubscriberID() string
SubscriberID returns string representation of the subscriber.
type Subscriptions ¶
type Subscriptions struct {
// contains filtered or unexported fields
}
Subscriptions is a collection of subscriptions that subscribe to a specific topic.
func (*Subscriptions) Add ¶
func (s *Subscriptions) Add(sub *Subscription)
Add adds the given subscription.
func (*Subscriptions) Delete ¶
func (s *Subscriptions) Delete(id string)
Delete deletes the subscription of the given id.
func (*Subscriptions) Map ¶
func (s *Subscriptions) Map() map[string]*Subscription
Map returns the internal map of this Subscriptions.