ringbuffer

package
v0.0.0-...-3b681cf Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2022 License: MIT Imports: 3 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

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 some data from the beginning of the buffer.

func (*RingBuffer) Push

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

Push pushes some data at the end of the buffer.

func (*RingBuffer) Reset

func (r *RingBuffer) Reset()

Reset restores Pull() after a Close().

Jump to

Keyboard shortcuts

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