tryTake

open suspend override fun tryTake(): Boolean

Try to take a token from the rate limiter.

Return

true if the rate limit is not exceeded, false otherwise


open suspend override 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