subscriptions

package
v0.6.10 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coordinator

type Coordinator struct {
	// contains filtered or unexported fields
}

Coordinator coordinates subscriptions by aggregating subscribers for the same target, and keeping them up to date for any updates that have happened for those targets.

func NewManager

func NewManager(ctx context.Context, logger *logger.Logger) *Coordinator

NewManager returns a new subscription manager

func (*Coordinator) FetchAllFlags

func (s *Coordinator) FetchAllFlags(ctx context.Context, key interface{}, target string) (isync.DataSync, error)

FetchAllFlags returns a DataSync containing the full set of flag configurations from the Coordinator. This will either occur via triggering a resync, or through setting up a new subscription to the resource

func (*Coordinator) GetActiveSubscriptionsInt64

func (s *Coordinator) GetActiveSubscriptionsInt64() int64

func (*Coordinator) RegisterSubscription

func (s *Coordinator) RegisterSubscription(
	ctx context.Context,
	target string,
	key interface{},
	dataSync chan isync.DataSync,
	errChan chan error,
)

RegisterSubscription starts a new subscription to the target resource. Once the subscription is set an ALL sync event will be received via the DataSync chan.

type Manager

type Manager interface {
	FetchAllFlags(
		ctx context.Context,
		key interface{},
		target string,
	) (isync.DataSync, error)
	RegisterSubscription(
		ctx context.Context,
		target string,
		key interface{},
		dataSync chan isync.DataSync,
		errChan chan error,
	)

	// metrics hooks
	GetActiveSubscriptionsInt64() int64
}

Manager defines the interface for the subscription management

Jump to

Keyboard shortcuts

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