buffer

package
v0.0.0-...-44b753e Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2016 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package buffer provides a thread-safe buffer implementation for a ring buffer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ring

type Ring struct {
	queue.Circular
}

Ring is a ring buffer implementation wrapping queue.Circular.

func NewRing

func NewRing(size int) *Ring

NewRing returns a ring buffer initalized with 'size' slots.

func (*Ring) Enqueue

func (r *Ring) Enqueue(item interface{}) error

Enqueue enques an item, If the buffer is full, the oldest item will be evicted.

Jump to

Keyboard shortcuts

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