fifo

package
v0.0.0-...-7d50ad2 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2015 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

some algorism

the fifo struct Note: the one fifo's max index cannot exceed the range of int32

the zk initialization

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseZkConn

func CloseZkConn()

func EstablishZkConn

func EstablishZkConn(hosts []string) error

Types

type DistributedFIFO

type DistributedFIFO struct {
	// contains filtered or unexported fields
}

func NewFifo

func NewFifo(path string, data []byte, prefix string) *DistributedFIFO

create the fifo

func (*DistributedFIFO) Poll

func (this *DistributedFIFO) Poll() (res []byte)

get one data from znodes and delete the chosen znode

func (*DistributedFIFO) Put

func (this *DistributedFIFO) Put(data []byte)

sequentially create a zonde

func (*DistributedFIFO) Size

func (this *DistributedFIFO) Size() (int, error)

get the size of the queue

Jump to

Keyboard shortcuts

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