RateSignals

What a response told the budget, passed to Permit.complete: whether the server throttled the call, how long it asked the caller to wait (retryAfter), and its readings by RateWindow.name. Build one with RateSignals { throttled = true; retryAfter = 30.seconds; reading("minute", WindowReading(0)) }.

Stable Core. A signal that is not throttled never pauses the budget (its readings still raise local counts); a reading for a window the budget does not have is ignored. RateSignals.None changes nothing. Equality is on the three properties; toString() prints the window names only.

Types

Link copied to clipboard

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

Link copied to clipboard
object Companion

The empty signal.

Properties

Link copied to clipboard

The readings by window name, a read-only copy.

Link copied to clipboard

The wait the server asked for, or null. Not negative.

Link copied to clipboard

Whether the server throttled the call (a 429, or a 503 that asks for a pause).

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Two RateSignals are equal when their throttled, retryAfter and readings are equal.

Link copied to clipboard
open override fun hashCode(): Int

Returns a hash code consistent with equals: it is computed from the same properties.

Link copied to clipboard
open override fun toString(): String

A diagnostic string for logs: throttled, retryAfter and the window names only, never a reading. Its format is not part of the API and may change.