Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateInstance ¶
type InstanceState ¶
type InstanceState int
const ( StateOffline InstanceState = iota StateBooting StateWaiting StateRunning )
type Pool ¶
type Pool[T Instance] struct { BootErrors chan error BootTime stat.AverageValue[time.Duration] // contains filtered or unexported fields }
Pool[T] provides the functionality of a generic pool of instances. The instance is assumed to boot, be controlled by one Runner and then be re-created. The pool is assumed to have one default Runner (e.g. to be used for fuzzing), while a dynamically controlled sub-pool might be reserved for the arbitrary Runners.
func NewPool ¶
func NewPool[T Instance](count int, creator CreateInstance[T], def Runner[T]) *Pool[T]
func (*Pool[T]) ReserveForRun ¶
ReserveForRun specifies the size of the sub-pool for the execution of custom runners. The reserved instances will be booted, but the pool will not start the default runner. To unreserve all instances, execute ReserveForRun(0).
func (*Pool[T]) Run ¶
Run blocks until it has found an instance to execute job and until job has finished.
func (*Pool[T]) SetDefault ¶
UpdateDefault forces all VMs to restart.
func (*Pool[T]) TogglePause ¶
type UpdateInfo ¶
type UpdateInfo func(cb func(info *Info))