RateLimitResult
Result of a rate limit check.
RateLimitResult::__construct()
public function __construct(bool $allowed, ?string $reason = null, ?int $retryAfterSeconds = null, ?int $remainingTokens = null):Parameters
| Name | Type | Description |
|---|---|---|
| $allowed | bool | |
| $reason | ?string | |
| $retryAfterSeconds | ?int | |
| $remainingTokens | ?int |
RateLimitResult::allowed()
public static function allowed(int $remainingTokens = 0): selfBuild a result permitting the call, reporting how many tokens remain in the current window.
Parameters
| Name | Type | Description |
|---|---|---|
| $remainingTokens | int |
RateLimitResult::denied()
public static function denied(string $reason, int $retryAfterSeconds = 0): selfBuild a result rejecting the call, with a reason and a suggested retry delay.
Parameters
| Name | Type | Description |
|---|---|---|
| $reason | string | |
| $retryAfterSeconds | int |