kubernetes: github.com/erimatnor/kubernetes/pkg/util/workqueue Index | Files

package workqueue

import "github.com/erimatnor/kubernetes/pkg/util/workqueue"

Package workqueue provides a simple queue that supports the following features:

* Fair: items processed in the order in which they are added.
* Stingy: a single item will not be processed multiple times concurrently,
    and if an item is added multiple times before it can be processed, it
    will only be processed once.
* Multiple consumers and producers. In particular, it is allowed for an
    item to be reenqueued while it is being processed.
* Shutdown notifications.


Package Files

doc.go queue.go

type Type Uses

type Type struct {
    // contains filtered or unexported fields

Type is a work queue (see the package comment).

func New Uses

func New() *Type

New constructs a new workqueue (see the package comment).

func (*Type) Add Uses

func (q *Type) Add(item interface{})

Add marks item as needing processing.

func (*Type) Done Uses

func (q *Type) Done(item interface{})

Done marks item as done processing, and if it has been marked as dirty again while it was being processed, it will be re-added to the queue for re-processing.

func (*Type) Get Uses

func (q *Type) Get() (item interface{}, shutdown bool)

Get blocks until it can return an item to be processed. If shutdown = true, the caller should end their goroutine. You must call Done with item when you have finished processing it.

func (*Type) ShutDown Uses

func (q *Type) ShutDown()

Shutdown will cause q to ignore all new items added to it. As soon as the worker goroutines have drained the existing items in the queue, they will be instructed to exit.

Package workqueue imports 1 packages (graph). Updated 2017-05-11. Refresh now. Tools for package owners.