ring_buffer

package
v0.10.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RingBuffer

type RingBuffer[T any] struct {
	// contains filtered or unexported fields
}

func NewRingBuffer

func NewRingBuffer[T any](cap int) *RingBuffer[T]

func (*RingBuffer[T]) Pop

func (rb *RingBuffer[T]) Pop() (T, error)

Pop blocks until an item is available

func (*RingBuffer[T]) Push

func (rb *RingBuffer[T]) Push(val T) error

Push adds a value, overwriting the oldest if full

func (*RingBuffer[T]) Stop

func (rb *RingBuffer[T]) Stop()

func (*RingBuffer[T]) TryPop

func (rb *RingBuffer[T]) TryPop() (T, bool, error)

TryPop tries to get an item without blocking

Jump to

Keyboard shortcuts

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