buffers

package
v0.2.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

README

pkg/controller/buffers

Fixed buffer sizes for EventBus subscriptions.

Overview

pkg/events.EventBus.Subscribe(name, bufferSize) requires a fixed buffer size. This package provides two presets covering every controller subscription:

Constant Size Use for
buffers.Critical 100 Business-critical paths where drops would mean missed reconciliation work (reconciler, deployer, validator)
buffers.Observability 200 Lossy paths where occasional drops are acceptable (commentator, metrics, debug ring buffer)

Quick Start

import (
    "gitlab.com/haproxy-haptic/haptic/pkg/controller/buffers"
    busevents "gitlab.com/haproxy-haptic/haptic/pkg/events"
)

eventChan := bus.Subscribe("my-component", buffers.Critical)
debugChan := bus.Subscribe("debug-events", buffers.Observability)

pkg/events also exposes fixed-size tier constants (LowVolumeSubscriberBuffer = 10, StandardSubscriberBuffer = 50, HighVolumeSubscriberBuffer = 100, PublishingSubscriberBuffer = 200, DebugSubscriberBuffer = 1000) for components that wire their own sizes directly.

See Also

  • pkg/events — the bus that consumes these sizes

License

Apache-2.0 — see root LICENSE.

Documentation

Overview

Package buffers provides fixed buffer sizes for event subscriptions.

Index

Constants

View Source
const (
	// Critical is the buffer size for business-critical components that need
	// reliable delivery (reconciler, deployer, validator).
	Critical = 100

	// Observability is the buffer size for lossy observability components that
	// can tolerate larger buffers and occasional drops (commentator, metrics,
	// debug ring buffer).
	Observability = 200
)

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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