Package dev.inmo.tgbotapi.bot.settings.limiters

Types

Link copied to clipboard
class CommonLimiter(    lockCount: Int = 10,     regenTime: MilliSeconds = 15 * 1000,     scope: CoroutineScope = CoroutineScope(Dispatchers.Default)) : RequestLimiter
Link copied to clipboard
class ExceptionsOnlyLimiter(defaultTooManyRequestsDelay: MilliSeconds = 1000) : RequestLimiter

This limiter will limit requests only after getting a RetryAfterError or ClientRequestException with HttpStatusCode.TooManyRequests status code. Important thing is that in case if some of block has been blocked, all the others will wait until it will be possible to be called

Link copied to clipboard
data class PowLimiter(    minAwaitTime: MilliSeconds = 0,     maxAwaitTime: MilliSeconds = 10000,     powValue: Double = 4.0,     powK: Double = 1.6,     scope: CoroutineScope = CoroutineScope(Dispatchers.Default)) : RequestLimiter
Link copied to clipboard
interface RequestLimiter