queue

package
v0.0.0-...-745d1e8 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

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

Queue implements a simple de-duplicating queue that assumes that when a consumer runs Pop it will finish its job, and that all the Add calls up to the Pop call are fulfilled.

It is safe for concurrent use by multiple goroutines AND processes.

The Queue keeps no memory of Pop-ed names, so the populator is supposed to know when a Pop happened more recently than the event triggering the Add.

func Open

func Open(dataSourceName string) (*Queue, error)

func (*Queue) Add

func (q *Queue) Add(name, parent string) error

Add is idempotent

func (*Queue) Close

func (q *Queue) Close() error

func (*Queue) Len

func (q *Queue) Len() (int, error)

func (*Queue) Pop

func (q *Queue) Pop() (name, parent string, err error)

Pop returns "", "", nil when the queue is empty

Jump to

Keyboard shortcuts

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