subscriptions

package
v3.30.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package subscriptions implements the events mux subscriptions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	// Subscribe subscribes to events.
	Subscribe(
		id uint64, identifiers []*ttnpb.EntityIdentifiers, after *time.Time, tail uint32, names []string,
	) error
	// Unsubscribe unsubscribe to events.
	Unsubscribe(id uint64) error

	// SubscriptionEvents provides the events for the underlying subscriptions.
	SubscriptionEvents() <-chan *SubscriptionEvent

	// Close closes all of the underlying subscriptions and waits for the background tasks to finish.
	Close() error
}

Interface is the interface for the events mux subscriptions.

func New

func New(
	ctx context.Context,
	cancel func(error),
	subscriber events.Subscriber,
	definedNames map[string]struct{},
	taskStarter task.Starter,
) Interface

New returns a new Interface.

type SubscriptionEvent

type SubscriptionEvent struct {
	ID    uint64
	Event events.Event
}

SubscriptionEvent wraps an events.Event with a subscription ID.

Jump to

Keyboard shortcuts

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