queue

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Install

type Install struct {
	Package   *provider.Package
	Installer *installer.Installer
}

Install describes an installment

type Queue

type Queue struct {
	Work   WorkQueue
	Worker WorkerQueue
}

Queue describes a queue

type Uninstall

type Uninstall struct {
	Install
}

Uninstall describes an uninstallment

type WorkQueue

type WorkQueue chan interface{}

WorkQueue describes the queue for the work

func New

func New(workers int) WorkQueue

New is providing the Queue

type Worker

type Worker struct {
	ID       int
	Work     WorkQueue
	Worker   WorkerQueue
	QuitChan chan bool
}

Worker is describing a worker to which work can be send

func NewWorker

func NewWorker(id int, queue Queue) Worker

NewWorker creates, and returns a new Worker object. Its only argument is a channel that the worker can add itself to whenever it is done its work.

func (*Worker) Start

func (w *Worker) Start()

Start is starting the worker by starting a goroutine.

func (*Worker) Stop

func (w *Worker) Stop()

Stop tells the worker to stop listening for work requests. Note that the worker will only stop *after* it has finished its work.

type WorkerQueue

type WorkerQueue chan chan interface{}

WorkerQueue describes the queue for the workers

Jump to

Keyboard shortcuts

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