Builder

Collects the properties of a WindowedCallBudget. Not thread-safe; use it only inside the factory's lambda. Stable Core.

Properties

Link copied to clipboard

A grant within this of a boundary is charged to both adjacent windows. 1 s by default; not negative; at most a quarter of the shortest period; truncated to whole milliseconds.

Link copied to clipboard

Each lane's share of every window as a held-back floor (never lent), ceil to units, at least 1 per positive share. Each in (0, 1]; the reserved units must fit every window. Interactive 0.2 by default — set emptyMap() for a window of limit 1.

Link copied to clipboard

The cap on any pause. 24 h by default; positive and finite.

Link copied to clipboard

The most calls that may wait on each lane; a lane at the cap refuses with QueueFull. 1,000 by default; not negative.

Link copied to clipboard

A snapshot stamped further ahead than this has its stamp and pause ignored (its counts are kept). 5 minutes by default; not negative.

Link copied to clipboard

Receives every event. BudgetObserver.None by default.

Link copied to clipboard

A hard window is saved write-ahead in blocks of this many grants. 10 by default; at least 1 (1 saves every grant). While saves succeed, a crash never under-counts the grants made and over-counts by at most persistAhead - 1 plus any units written ahead and then given back; while the store is failing, grants run unsaved and a crash loses them (the budget's class KDoc states the exceptions).

Link copied to clipboard

Where hard windows and the pause survive a restart. An InMemoryBudgetStore by default (survives nothing).

Link copied to clipboard

After a failed restore or a failed write-ahead save, the next attempt waits this long. 30 s by default; not negative.

Link copied to clipboard

Bounds each store call. 2 s by default; positive. A blocking store cannot be interrupted: see BudgetStore.

Link copied to clipboard

The clock of every wait and duration; one mark is taken at construction. TimeSource.Monotonic by default.

Link copied to clipboard

The clock that decides window indices and boundaries. WallClock.System by default; its reading may step.