Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Distributor ¶
type Distributor interface { // Publish publishes traffic to the subscribers. Publish(context.Context, *ttnpb.ApplicationUp) error // Subscribe to the traffic of a specific application. Subscribe(context.Context, string, *ttnpb.ApplicationIdentifiers) (*io.Subscription, error) }
Distributor sends upstream traffic from publishers to subscribers.
func NewLocalDistributor ¶
func NewLocalDistributor(ctx context.Context, rd RequestDecoupler, timeout time.Duration, broadcastOpts []io.SubscriptionOption, mapOpts []io.SubscriptionOption) Distributor
NewLocalDistributor creates a Distributor that routes the traffic locally. The underlying subscription sets can timeout if there are no active subscribers. A timeout of 0 means the underlying subscriptions never timeout.
func NewPubSubDistributor ¶
func NewPubSubDistributor(ctx context.Context, rd RequestDecoupler, timeout time.Duration, pubsub PubSub, mapOpts []io.SubscriptionOption) Distributor
NewPubSubDistributor creates a Distributor on top of the provided PubSub. The underlying subscription sets can timeout if there are no active subscribers. A timeout of 0 means the underlying subscription sets never timeout.
type PubSub ¶
type PubSub interface { // Publish publishes traffic to the subscribers. Publish(context.Context, *ttnpb.ApplicationUp) error // Subscribe to the traffic of a specific application. Subscribe(context.Context, *ttnpb.ApplicationIdentifiers, func(context.Context, *ttnpb.ApplicationUp) error) error }
PubSub sends upstream traffic from publishers to subscribers.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.