subscriptions

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2025 License: MIT Imports: 7 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL