ringbuff

package
v0.0.0-...-f2d3d7a Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2018 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 RingBuff

type RingBuff struct {
	sync.Mutex
	// contains filtered or unexported fields
}

RingBuff implements a circular list.

func New

func New(n int) *RingBuff

New creates a RingBuff.

func (*RingBuff) Close

func (r *RingBuff) Close() error

Close closes the RingBuff.

func (*RingBuff) Pop

func (r *RingBuff) Pop() (interface{}, bool)

Pop returns a element, if RingBuff is empty, Pop() will block.

func (*RingBuff) Push

func (r *RingBuff) Push(value interface{}) bool

Push puts a elemnet into RingBuff and returns the status of covering or not.

Jump to

Keyboard shortcuts

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