workerqueue

package
v0.0.0-...-5cd796c Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package workerqueue extends client-go's workqueue functionality into an opinionated queue + worker model that is reusable

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler func(string) error

Handler is the handler for processing the work queue This is usually a syncronisation handler for a controller or related

type WorkerQueue

type WorkerQueue struct {

	// SyncHandler is exported to make testing easier (hack)
	SyncHandler Handler
	// contains filtered or unexported fields
}

WorkerQueue is an opinionated queue + worker for use with controllers and related and processing Kubernetes watched events and synchronising resources

func NewWorkerQueue

func NewWorkerQueue(handler Handler, logger *logrus.Entry, name string) *WorkerQueue

NewWorkerQueue returns a new worker queue for a given name

func (*WorkerQueue) Enqueue

func (wq *WorkerQueue) Enqueue(obj interface{})

Enqueue puts the name of the runtime.Object in the queue to be processed. If you need to send through an explicit key, use an cache.ExplicitKey

func (*WorkerQueue) Run

func (wq *WorkerQueue) Run(threadiness int, stop <-chan struct{})

Run the WorkerQueue processing via the Handler. Will block until stop is closed. Runs threadiness number workers to process the rate limited queue

Jump to

Keyboard shortcuts

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