hyperhive/hive-jobq/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas 9e91bf7813 refactor(#2949): claim_one is the primitive, settle is it in a loop
One-at-a-time claiming is what lets a caller choose between claiming again
immediately and backing off — a batch return cannot express that choice,
and the choice is the point: the run loop wants to know there was work
before it decides whether to wait.

`settle()` keeps its exact meaning as `while let Some(id) = claim_one()`.
A node started by an earlier iteration is `Running`, not terminal, so it
cannot satisfy another node's dependency in the same sweep; it only
consumes resources. The crate's ~45 existing `settle()` assertions — which
cover resource borrowing, cap-1 serialisation, roll-up and cancellation —
are what verify that equivalence, so it is checked rather than argued.

`None` means "nothing runnable right now", which is deliberately a
different statement from "nothing pending": a node can be pending and
unrunnable because its resources are held elsewhere.

Cost stated rather than left to be found: each `claim_one` rescans the
pending set, so `settle` is O(n^2) in nodes claimed where the single-pass
version was O(n). The graph is bounded by history retention.
2026-08-02 22:00:34 +02:00
..
builder.rs jobq: drop JobBuilder's Default impl so it is really unconstructible outside 2026-08-02 22:00:34 +02:00
lib.rs jobq: make the builder the only way nodes enter a graph 2026-08-02 15:45:27 +02:00
resources.rs refactor(#2500): encapsulate the jobq lock, drop the dead borrowed-guard layer 2026-07-19 15:24:11 +02:00
scheduler.rs refactor(#2949): claim_one is the primitive, settle is it in a loop 2026-08-02 22:00:34 +02:00