queue

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNamespacedWarmPoolName

func GetNamespacedWarmPoolName(namespace, warmPoolName string) string

GetNamespacedWarmPoolName forms the namespace-aware index value to use as a key to a SimpleSandboxQueue type.

Types

type SandboxKey

type SandboxKey struct {
	Namespace string
	Name      string
	NodeName  string
}

SandboxKey uniquely identifies a sandbox in the queue.

type SimpleSandboxQueue

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

SimpleSandboxQueue is a thread-safe queue of adoptable warm pool sandboxes.

func NewSimpleSandboxQueue

func NewSimpleSandboxQueue() *SimpleSandboxQueue

NewSimpleSandboxQueue initializes a new SimpleSandboxQueue.

func (*SimpleSandboxQueue) Add

func (s *SimpleSandboxQueue) Add(namespacedWarmPoolName string, item SandboxKey)

Add pushes an item to the specific warm pool's queue.

func (*SimpleSandboxQueue) GetWithStrategy

func (s *SimpleSandboxQueue) GetWithStrategy(namespacedWarmPoolName string, pick Strategy) (SandboxKey, bool)

GetWithStrategy pops an item from the specific warm pool's queue using a custom strategy.

func (*SimpleSandboxQueue) Len

func (s *SimpleSandboxQueue) Len(namespacedWarmPoolName string) int

Len reports how many sandboxes a warm pool's queue holds.

func (*SimpleSandboxQueue) RemoveItem

func (s *SimpleSandboxQueue) RemoveItem(namespacedWarmPoolName string, item SandboxKey)

RemoveItem deletes a specific sandbox from a warm pool's queue.

func (*SimpleSandboxQueue) RemoveQueue

func (s *SimpleSandboxQueue) RemoveQueue(namespacedWarmPoolName string)

RemoveQueue completely deletes a warm pool's queue from the sync.Map to prevent memory leaks when SandboxTemplates or WarmPools are deleted.

type Strategy

type Strategy func([]SandboxKey) (SandboxKey, bool)

Strategy picks one key from a warm pool's queued sandboxes; false leaves the queue untouched.

Jump to

Keyboard shortcuts

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