budget

fun budget(budget: CallBudget)(source)

Uses budget, which the caller owns: the client never closes it. A later budget(...) call replaces an earlier one. Without any, the client uses CallBudget.Unlimited.

Parameters

budget

the budget calls are charged to.


fun budget(windows: List<RateWindow>, configure: WindowedCallBudget.Builder.() -> Unit = {})(source)

Builds a WindowedCallBudget over windows when the factory runs, after this whole lambda, and owns it: the client closes it. Its builder is seeded with this configuration's final timeSource and wallClock; then configure runs, so an explicit assignment there wins. A later budget(...) call replaces an earlier one.

Parameters

windows

the provider's rate windows; see WindowedCallBudget.

configure

assigns the budget's optional properties; empty by default.