queue

package
v0.0.0-...-7594f3d Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEmptyQueue is returned from Pop.
	ErrEmptyQueue = errors.New("No pod queued")
	// ErrDifferentNames is returned from Update.
	ErrDifferentNames = errors.New("Original and new pods have different names")
)

Functions

This section is empty.

Types

type ErrNoMatchingPod

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

ErrNoMatchingPod is returned from Update.

func (*ErrNoMatchingPod) Error

func (e *ErrNoMatchingPod) Error() string

type FIFOQueue

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

FIFOQueue stores pods in a FIFO queue.

func NewFIFOQueue

func NewFIFOQueue() *FIFOQueue

NewFIFOQueue creates a new FIFOQueue.

func (*FIFOQueue) Front

func (fifo *FIFOQueue) Front() (*utils.AppGroup, string, error)

func (*FIFOQueue) Get

func (fifo *FIFOQueue) Get() map[string]*utils.AppGroup

func (*FIFOQueue) Pop

func (fifo *FIFOQueue) Pop() (*utils.AppGroup, string, error)

func (*FIFOQueue) Push

func (fifo *FIFOQueue) Push(key string, appGroup *utils.AppGroup) error

type PodQueue

type PodQueue interface {
	// Push pushes the pod to the "end" of this PodQueue.
	Push(key string, pod *utils.AppGroup) error

	// Pop pops the pod on the "front" of this PodQueue.
	// This method never blocks; Immediately returns ErrEmptyQueue if the queue is empty.
	Pop() (*utils.AppGroup, string, error)

	// Front refers (not pops) the pod on the "front" of this PodQueue.
	// This method never bocks; Immediately returns ErrEmptyQueue if the queue is empty.
	Front() (*utils.AppGroup, string, error)

	// Get fifoQueue key
	Get() map[string]*utils.AppGroup
}

PodQueue defines the interface of pod queues.

Jump to

Keyboard shortcuts

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