ringbuffer

package
v3.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package ringbuffer contains a ring buffer.

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 is a ring buffer.

func New

func New(size uint64) (*RingBuffer, error)

New allocates a RingBuffer.

func (*RingBuffer) Close

func (r *RingBuffer) Close()

Close makes Pull() return false.

func (*RingBuffer) Pull

func (r *RingBuffer) Pull() (interface{}, bool)

Pull pulls data from the beginning of the buffer.

func (*RingBuffer) Push

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

Push pushes data at the end of the buffer.

func (*RingBuffer) Reset

func (r *RingBuffer) Reset()

Reset restores Pull() behavior after a Close().

Jump to

Keyboard shortcuts

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