jobqueue

package module
v0.0.0-...-1ab53be Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HiveType

type HiveType string

type Job

type Job interface {
	PerformWork()
}

type SimplePool

type SimplePool struct {
	NumWorkers int
	// contains filtered or unexported fields
}

func NewSimplePool

func NewSimplePool(numWorkers int) *SimplePool

func (*SimplePool) AddJob

func (p *SimplePool) AddJob(job Job)

func (*SimplePool) Run

func (p *SimplePool) Run()

func (*SimplePool) Stop

func (p *SimplePool) Stop()

type SimpleWorker

type SimpleWorker struct {
	JobChannel  chan Job
	QuitChannel chan bool
}

func (SimpleWorker) Start

func (w SimpleWorker) Start()

func (SimpleWorker) Stop

func (w SimpleWorker) Stop()

type Worker

type Worker struct {
	WorkerPool  chan chan Job
	JobChannel  chan Job
	QuitChannel chan bool
}

func (Worker) Start

func (w Worker) Start()

func (Worker) Stop

func (w Worker) Stop()

type WorkerDispatcher

type WorkerDispatcher struct {
	WorkerHives map[HiveType]WorkerHive
}

func NewWorkerDispatcher

func NewWorkerDispatcher() *WorkerDispatcher

func (WorkerDispatcher) Dispatch

func (w WorkerDispatcher) Dispatch(hiveType HiveType, jobQueue chan Job, numWorkers int)

func (WorkerDispatcher) GetJobQueue

func (w WorkerDispatcher) GetJobQueue(hiveType HiveType) chan Job

func (WorkerDispatcher) NewWorker

func (w WorkerDispatcher) NewWorker(workerPool chan chan Job) Worker

type WorkerHive

type WorkerHive struct {
	Workers    []*Worker
	WorkerPool chan chan Job
	JobQueue   chan Job
}

Jump to

Keyboard shortcuts

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