NewRateLimiter
Creates a new rate-limiter with the specified transactions per second (tps) and burst values.
def NewRateLimiter(
rateLimiterName: string,
tps: float64,
burst: int
) - > RateLimiter
Creates a new rate-limiter with the specified transactions per second (tps) and burst values. Callers use this to control the rate at which operations can be performed.
Parameters
| Name | Type | Description |
|---|---|---|
| rateLimiterName | string | The name to assign to the rate limiter, used for identification or logging purposes. |
| tps | float64 | The desired rate limit in transactions per second (TPS). This defines how many operations are allowed per second on average. |
| burst | int | The maximum burst size allowed. This specifies how many operations can exceed the TPS limit in a short period before being throttled. |
Returns
| Type | Description |
|---|---|
RateLimiter | A new RateLimiter instance configured with the given tps and burst limits. |