processor

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 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 FeatureFlagProcessor

type FeatureFlagProcessor interface {
	// Run the processor to poll the latest cache from the server
	Run()

	// Close tears down all Processor activities, after ensuring that all events have been delivered.
	Close()
}

FeatureFlagProcessor defines the interface for processing feature flags cache.

In the background, the Processor polls the latest feature flags from the server, and updates them in the local cache.

type FeatureFlagProcessorConfig

type FeatureFlagProcessorConfig struct {
	// Cache
	Cache cache.Cache

	// PollingInterval is a interval of polling feature flags from the server
	PollingInterval time.Duration

	// APIClient is the client for Bucketeer service.
	APIClient api.Client

	// PushLatencyMetricsEvent pushes the get evaluation latency metrics event to the queue.
	PushLatencyMetricsEvent func(duration time.Duration, api model.APIID)

	// PushSizeMetricsEvent pushes the get evaluation size metrics event to the queue.
	PushSizeMetricsEvent func(sizeByte int, api model.APIID)

	// Push error metric events to Bucketeer service
	PushErrorEvent func(err error, api model.APIID)

	// Loggers is the Bucketeer SDK Loggers.
	Loggers *log.Loggers

	// Tag is the Feature Flag tag
	// The tag is set when a Feature Flag is created, and can be retrieved from the admin console.
	Tag string
}

ProcessorConfig is the config for Processor.

type SegmentUserProcessor

type SegmentUserProcessor interface {
	// Run the processor to poll the latest cache from the server
	Run()

	// Close tears down all Processor activities, after ensuring that all events have been delivered.
	Close()
}

SegmentUserProcessor defines the interface for processing segment users cache.

In the background, the Processor polls the latest segment users from the server, and updates them in the local cache.

type SegmentUserProcessorConfig

type SegmentUserProcessorConfig struct {
	// Cache
	Cache cache.Cache

	// PollingInterval is a interval of polling segment users from the server
	PollingInterval time.Duration

	// APIClient is the client for Bucketeer service.
	APIClient api.Client

	// PushLatencyMetricsEvent pushes the get evaluation latency metrics event to the queue.
	PushLatencyMetricsEvent func(duration time.Duration, api model.APIID)

	// PushSizeMetricsEvent pushes the get evaluation size metrics event to the queue.
	PushSizeMetricsEvent func(sizeByte int, api model.APIID)

	// PushErrorEvent pushes error metric events to Bucketeer service
	PushErrorEvent func(err error, api model.APIID)

	// Loggers is the Bucketeer SDK Loggers.
	Loggers *log.Loggers

	// Tag is the Feature Flag tag
	// The tag is set when a Feature Flag is created, and can be retrieved from the admin console.
	//
	// Note: this tag is used to report metric events.
	Tag string
}

ProcessorConfig is the config for Processor.

Jump to

Keyboard shortcuts

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