sticky

package
v0.3.0-20261106200550-... Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

sticky

The sticky Allocator fills only free budget slots and leaves every in-flight build running. Against the budget it counts the paths that still hold a slot: pending, building, and cancelling — a cancel is only a request, and the build keeps its slot until it actually stops. Only path status enters this — no batch state does, since the budget tracks builds occupying CI.

It then proposes a build for each new candidate, in order, until the budget fills. Two kinds of candidate are skipped, for different reasons. A candidate matching an already-funded path is holding a slot already — it is counted above — so it needs no additional slot and no second build action. A candidate whose path is terminal in the path sets holds no slot and needs none. Neither consumes free budget. It never proposes a cancel.

The budget is measured in builds: one slot per path, no matter what that path's build does. That is deliberately coarse — a twelve-hour build and a two-minute build cost the same slot. An allocator that understands build size (target count, historical duration) could pack the same budget more effectively; sticky trades that for simplicity.

A stored path with no status at all is a data defect, and sticky fails fast: Allocate returns an error rather than guessing what the record means.

The trade-off: a better candidate arriving while the budget is full waits for a running build to finish rather than displacing it. sticky never discards work already started, and it cannot react to a newly attractive path mid-flight. Its counterpart is a preempting Allocator that cancels a low-value in-flight path to fund a better one, spending a cancel now to converge faster on the next run.

Documentation

Overview

Package sticky provides an allocator.Allocator that fills only free budget slots and leaves every in-flight build running — it never preempts. Its policy counterpart is a preempting allocator, which would cancel a low-value in-flight path to fund a better candidate; sticky trades that responsiveness for never discarding a build it has already started.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(budget int) allocator.Allocator

New returns a sticky allocator.Allocator with the given budget, measured in concurrent builds.

Types

This section is empty.

Jump to

Keyboard shortcuts

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