BC-2 Budgets — declarative budgets, policy, assertion.
Pure. No I/O. No deps on hive-weave or hive-events. See PLAN.md §2 BC-2.
BC-2 Budgets — declarative budgets, policy, assertion. Pure. No I/O. No deps on hive-weave or hive-events. See PLAN.md §2 BC-2.
(child-budget parent-budget declared-ms policy-kw)Nested-span inheritance rule (PLAN §9 Q1): child.budget = min(declared, parent.remaining-ms).
Nested-span inheritance rule (PLAN §9 Q1): child.budget = min(declared, parent.remaining-ms).
(exceeded? budget)Opposite of within?. Named for readability at call sites.
Opposite of within?. Named for readability at call sites.
(policy this)One of #{:hard :soft :partial}.
One of #{:hard :soft :partial}.
(remaining-ms this)Milliseconds until deadline, clamped ≥ 0.
Milliseconds until deadline, clamped ≥ 0.
(within? this)True if now-t0 <= total-ms.
True if now-t0 <= total-ms.
(make-budget total-ms)(make-budget total-ms policy-kw)Construct a Budget. Valid policies: #{:hard :soft :partial}.
Construct a Budget. Valid policies: #{:hard :soft :partial}.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |