queue

package
v0.11.6 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package queue features a scheduling queue, which keeps track of all placements for the scheduler to schedule.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterResourcePlacementKey added in v0.6.5

type ClusterResourcePlacementKey string

ClusterResourcePlacementKey is the unique identifier (its name) for a ClusterResourcePlacement checked into a scheduling queue.

type ClusterResourcePlacementSchedulingQueue added in v0.6.5

type ClusterResourcePlacementSchedulingQueue interface {
	ClusterResourcePlacementSchedulingQueueWriter

	// Run starts the scheduling queue.
	Run()
	// Close closes the scheduling queue immediately.
	Close()
	// CloseWithDrain closes the scheduling queue after all items in the queue are processed.
	CloseWithDrain()
	// NextClusterResourcePlacementKey returns the next-in-line ClusterResourcePlacementKey for the scheduler to consume.
	NextClusterResourcePlacementKey() (key ClusterResourcePlacementKey, closed bool)
	// Done marks a ClusterResourcePlacementKey as done.
	Done(crpKey ClusterResourcePlacementKey)
	// Forget untracks a ClusterResourcePlacementKey from rate limiter(s) (if any) set up with the queue.
	Forget(crpKey ClusterResourcePlacementKey)
}

ClusterResourcePlacementSchedulingQueue is an interface which queues ClusterResourcePlacements for the scheduler to consume; specifically, the scheduler finds the latest scheduling policy snapshot associated with the ClusterResourcePlacement.

func NewSimpleClusterResourcePlacementSchedulingQueue added in v0.6.5

func NewSimpleClusterResourcePlacementSchedulingQueue(opts ...Option) ClusterResourcePlacementSchedulingQueue

NewSimpleClusterResourcePlacementSchedulingQueue returns a simpleClusterResourcePlacementSchedulingQueue.

type ClusterResourcePlacementSchedulingQueueWriter added in v0.6.5

type ClusterResourcePlacementSchedulingQueueWriter interface {
	// Add adds a ClusterResourcePlacementKey to the work queue.
	//
	// Note that this bypasses the rate limiter.
	Add(crpKey ClusterResourcePlacementKey)
	// AddRateLimited adds a ClusterResourcePlacementKey to the work queue after the rate limiter (if any)
	// says that it is OK.
	AddRateLimited(crpKey ClusterResourcePlacementKey)
	// AddAfter adds a ClusterResourcePlacementKey to the work queue after a set duration.
	AddAfter(crpKey ClusterResourcePlacementKey, duration time.Duration)
}

ClusterResourcePlacementSchedulingQueueWriter is an interface which allows sources, such as controllers, to add ClusterResourcePlacementKeys to the scheduling queue.

type Option

type Option func(*simpleClusterResourcePlacementSchedulingQueueOptions)

Option is the function that configures the simpleClusterResourcePlacmentSchedulingQueue.

func WithName added in v0.6.5

func WithName(name string) Option

WithName sets a name for the workqueue.

func WithRateLimiter added in v0.6.5

func WithRateLimiter(rateLimiter workqueue.RateLimiter) Option

WithRateLimiter sets a rate limiter for the workqueue.

Jump to

Keyboard shortcuts

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