consume

inline suspend fun <T> RateLimiter.consume(action: () -> T): T(source)

Acquires a permit for a single action. Suspends if necessary until the permit would not exceed the maximum frequency of permits.

Parameters

action

The action that correlates to a single permit.