concurrentqueuer

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package concurrentqueuer defines a queuer.Interface that runs several workers concurrently on a queue

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queuer

type Queuer struct {
	Length  int // Max queue length
	Workers int // Number of concurrent workers
	// contains filtered or unexported fields
}

Queuer is a queuer.Interface that runs several workers concurrently on a queue.

func (*Queuer) Push

func (q *Queuer) Push(item string) error

Push attempts to add an item to the queue. On failure, returns queuer.ErrDuplicate or queuer.ErrFull.

func (*Queuer) Start

func (q *Queuer) Start(action func(string))

Start starts processing the queue.

func (*Queuer) Wait

func (q *Queuer) Wait()

Wait waits for all items to be processed before returning.

Jump to

Keyboard shortcuts

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