workqueue

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FifoQueue

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

FifoQueue implement abstract quene

func New

func New() *FifoQueue

New create a new work queue with default name

func NewNamedQueue

func NewNamedQueue(name string) *FifoQueue

NewNamedQueue create a new work queue with name

func (*FifoQueue) Add

func (f *FifoQueue) Add(item interface{})

Add make item to be processing

func (*FifoQueue) Done

func (f *FifoQueue) Done(item interface{})

Done make processing item to be done

func (*FifoQueue) Get

func (f *FifoQueue) Get() (item interface{}, shutdown bool)

Get return an item to be processed

func (*FifoQueue) Len

func (f *FifoQueue) Len() int

Len return current quee length

func (*FifoQueue) Shutdown

func (f *FifoQueue) Shutdown()

Shutdown close the queue and exit all processing items

func (*FifoQueue) ShuttingDown

func (f *FifoQueue) ShuttingDown() bool

ShuttingDown check current shutting down state

type Queue

type Queue interface {
	Add(item interface{})
	Len() int
	Get() (item interface{}, shutdown bool)
	Done(item interface{})
	Shutdown()
	ShuttingDown() bool
}

Queue for abstract work queue

Jump to

Keyboard shortcuts

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