parallelwork

package
v0.3.0-pre8 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: Apache-2.0 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 {
	ProgressCallback func(enqueued, active, completed int64)
	// contains filtered or unexported fields
}

Queue represents a work queue with multiple parallel workers.

func NewQueue

func NewQueue() *Queue

NewQueue returns new parallel work queue.

func (*Queue) EnqueueBack

func (v *Queue) EnqueueBack(callback func())

EnqueueBack adds the work to the back of the queue.

func (*Queue) EnqueueFront

func (v *Queue) EnqueueFront(callback func())

EnqueueFront adds the work to the front of the queue.

func (*Queue) Process

func (v *Queue) Process(workers int)

Process starts N workers, which will be processing elements in the queue until the queue is empty and all workers are idle.

Jump to

Keyboard shortcuts

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