Documentation
¶
Index ¶
Constants ¶
View Source
const (
WILDCARD_TOPIC = "*"
)
Variables ¶
View Source
var ErrNilEnvelope = errors.New("received nil envelope")
Functions ¶
This section is empty.
Types ¶
type Subscription ¶
type Subscription struct {
MessagesCh chan *proto.Envelope // Channel for receiving messages
// contains filtered or unexported fields
}
subscription represents a single subscription, including its message channel and topics.
func (*Subscription) Unsubscribe ¶
func (sub *Subscription) Unsubscribe()
Unsubscribe removes the subscription from its dispatcher.
type SubscriptionDispatcher ¶
type SubscriptionDispatcher struct {
// contains filtered or unexported fields
}
subscriptionDispatcher manages subscriptions and message dispatching.
func NewSubscriptionDispatcher ¶
func NewSubscriptionDispatcher(log *zap.Logger) *SubscriptionDispatcher
newSubscriptionDispatcher creates a new dispatcher for managing subscriptions.
func (*SubscriptionDispatcher) HandleEnvelope ¶
func (d *SubscriptionDispatcher) HandleEnvelope(env *proto.Envelope)
messageHandler processes incoming messages, dispatching them to the correct subscription.
func (*SubscriptionDispatcher) Subscribe ¶
func (d *SubscriptionDispatcher) Subscribe(topics map[string]bool) *Subscription
Subscribe creates a new subscription for the given topics.
Click to show internal directories.
Click to hide internal directories.