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
Click to show internal directories.
Click to hide internal directories.