Documentation
¶
Overview ¶
Package runqueue coordinates CPU-heavy commands across WB processes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Lease ¶
type Lease struct {
// contains filtered or unexported fields
}
Lease holds units machine-wide until Release. Slot files live below the projects root so harnesses already permitted to write repositories can join the same budget without requiring access to the user's home directory.
func Acquire ¶
func Acquire(ctx context.Context, projectsRoot string, units, budget int) (*Lease, time.Duration, error)
Acquire waits for units from one projects-root budget. Each attempt either acquires every requested slot or releases all partial locks before waiting, preventing two multi-unit commands from deadlocking one another.
Click to show internal directories.
Click to hide internal directories.