queue

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: MIT Imports: 2 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TooManyItemsQueued = errors.New("Sorry, too many items queued - try later.")

Functions

This section is empty.

Types

type Queue

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

func New

func New(workers, max int) *Queue

func (*Queue) Slot

func (q *Queue) Slot(log func(int)) (start, end chan struct{}, err error)

Slot requests a slot in the queue. The log function is called when the queue position changes. Execution of the work should not start until the start channel has been closed. The end channel should be closed when work is finished.

Jump to

Keyboard shortcuts

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