ringbuffer

package
v0.0.0-...-32e28cf Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 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 struct {
	// contains filtered or unexported fields
}

RingBuffer holds the ring buffer and the synchronization primitives

func New

func New(capacity int) *RingBuffer

New creates new ring buffer

func (*RingBuffer) Empty

func (r *RingBuffer) Empty() bool

func (*RingBuffer) Pop

func (r *RingBuffer) Pop() (interface{}, error)

Pop removes value from ring buffer.

func (*RingBuffer) Push

func (r *RingBuffer) Push(value interface{})

Push inserts new value to ring buffer. Overflow signals if ring buffer was full when Push was called.

Jump to

Keyboard shortcuts

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