BatchThrottler

class BatchThrottler(rateLimit: Int = 10, sleepTime: Long = 1000) : BaseThrottler

Throttler implementation based on a batch execution rate.

Allow rateLimit requests per second before sleeping for a specific sleepTime.

Parameters

rateLimit

The maximum number of executions allowed within the specified time interval.

sleepTime

The time interval in milliseconds between batches of executions.

Constructors

Link copied to clipboard
constructor(rateLimit: Int = 10, sleepTime: Long = 1000)

Functions

Link copied to clipboard
open suspend override fun wait()

Suspend the execution until the throttling conditions are met.