ringbuffer

package
v0.0.0-...-0bddacc Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Default retry configuration for production use
	// Retry 1: 500ms, Retry 2: 1.5s, Retry 3: 3s (total ~5s to 4th attempt)
	DefaultBaseDelay = 500 * time.Millisecond
	DefaultMaxDelay  = 3 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*config)

func WithRetryConfig

func WithRetryConfig(baseDelay, maxDelay time.Duration) Option

type QueuedHealthEvents

type QueuedHealthEvents struct {
	Events            *protos.HealthEvents
	ParentSpanContext trace.SpanContext
}

QueuedHealthEvents carries health events and the trace context from the gRPC handler so store and K8s connectors can continue the same trace.

func NewQueuedHealthEvents

func NewQueuedHealthEvents(events *protos.HealthEvents) *QueuedHealthEvents

type RingBuffer

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

func NewRingBuffer

func NewRingBuffer(ringBufferName string, ctx context.Context, opts ...Option) *RingBuffer

func (*RingBuffer) AddRateLimited

func (rb *RingBuffer) AddRateLimited(data *QueuedHealthEvents)

func (*RingBuffer) CurrentLength

func (rb *RingBuffer) CurrentLength() int

func (*RingBuffer) Dequeue

func (rb *RingBuffer) Dequeue() (*QueuedHealthEvents, bool)

func (*RingBuffer) Enqueue

func (rb *RingBuffer) Enqueue(item *QueuedHealthEvents)

func (*RingBuffer) HealthMetricEleProcessingCompleted

func (rb *RingBuffer) HealthMetricEleProcessingCompleted(data *QueuedHealthEvents)

func (*RingBuffer) HealthMetricEleProcessingFailed

func (rb *RingBuffer) HealthMetricEleProcessingFailed(data *QueuedHealthEvents)

func (*RingBuffer) NumRequeues

func (rb *RingBuffer) NumRequeues(data *QueuedHealthEvents) int

func (*RingBuffer) ShutDownHealthMetricQueue

func (rb *RingBuffer) ShutDownHealthMetricQueue()

Jump to

Keyboard shortcuts

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