tryTake

abstract suspend fun tryTake(): Boolean

Try to take a token from the rate limiter.

Return

true if the rate limit is not exceeded, false otherwise


abstract suspend fun tryTake(key: String): Boolean

Try to take a token for the given key from the rate limiter.

Return

true if the rate limit is not exceeded, false otherwise

Parameters

key

the key to use to take the token