ringbuffer

package module
v0.0.0-...-104e4b5 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2013 License: Apache-2.0 Imports: 1 Imported by: 4

README

ringbuffer

Documentation

Overview

Ringbuffer implements a ring buffer that can leverage different storage engines and wait strategies. It is modeled after the LMAX Disruptor architecture.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMinSeq

func GetMinSeq(gates []Sequencer, min int64) (int64, error)

func PowerOfTwo

func PowerOfTwo(n int) bool

powerOfTwo determines whether n is of power of two

Types

type Consumer

type Consumer interface {
	Get() (interface{}, error)
}

type Producer

type Producer interface {
	Put(interface{}) (int, error)
}

type RingBuffer

type RingBuffer interface {
	NewProducer() (Producer, error)
	NewConsumer() (Consumer, error)
}

type Sequencer

type Sequencer interface {
	Get() (int64, error)
	Set(int64) error
	Next(int) (int64, error)
	Request(int) (int64, error)
	Commit(int64) error
	AddGatingSequence(...Sequencer)
	RemoveGatingSequence(Sequencer)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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