Documentation
¶
Index ¶
- func GetNamespacedWarmPoolName(namespace, warmPoolName string) string
- type SandboxKey
- type SimpleSandboxQueue
- func (s *SimpleSandboxQueue) Add(namespacedWarmPoolName string, item SandboxKey)
- func (s *SimpleSandboxQueue) GetWithStrategy(namespacedWarmPoolName string, pick Strategy) (SandboxKey, bool)
- func (s *SimpleSandboxQueue) Len(namespacedWarmPoolName string) int
- func (s *SimpleSandboxQueue) RemoveItem(namespacedWarmPoolName string, item SandboxKey)
- func (s *SimpleSandboxQueue) RemoveQueue(namespacedWarmPoolName string)
- type Strategy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNamespacedWarmPoolName ¶
GetNamespacedWarmPoolName forms the namespace-aware index value to use as a key to a SimpleSandboxQueue type.
Types ¶
type SandboxKey ¶
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.