buffers

package
v0.1.0-alpha.12 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package buffers provides memory-adaptive buffer size calculation for event subscriptions.

Buffer sizes are scaled based on GOMEMLIMIT (set by automemlimit from cgroup memory). Larger containers automatically get larger buffers, reducing event drops.

Index

Constants

View Source
const (
	// BaseSize is the minimum buffer size when memory limit is unknown or very low.
	BaseSize = 100

	// MaxSize caps buffer sizes to prevent excessive memory usage.
	MaxSize = 10000
)

Variables

This section is empty.

Functions

func Critical

func Critical() int

Critical returns buffer size for business-critical components.

Uses a 1x multiplier - these components need reliable delivery but don't need oversized buffers.

func Observability

func Observability() int

Observability returns buffer size for lossy observability components.

Uses a 2x multiplier since these components can tolerate larger buffers and occasional drops are acceptable.

Types

This section is empty.

Jump to

Keyboard shortcuts

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