kubernetesk8s.io/kubernetes/pkg/util/workqueue Index | Files

package workqueue

import "k8s.io/kubernetes/pkg/util/workqueue"

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

Index

Types

type Type

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

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

func New

func New() *Type

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

func (*Type) Add

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

Add marks item as needing processing.

func (*Type) Done

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

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) Len

func (q *Type) Len() int

Len returns the current queue length, for informational purposes only. You shouldn't e.g. gate a call to Add() or Get() on Len() being a particular value, that can't be synchronized properly.

func (*Type) ShutDown

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.

Source Files

doc.go queue.go

Version
v1.1.2
Published
Nov 19, 2015
Platform
darwin/amd64
Imports
1 packages
Last checked
30 seconds ago

Tools for package owners.