trait HasRateLimits

Methods

bool
usesRateLimits(PendingRequest $pendingRequest)

Determine if this resource's rate limits apply to an operation.

array
resolveRateLimitPolicies(PendingRequest $pendingRequest)

Resolve the admission policies for an operation.

UnitEnum|string|null
resolveRateLimitStoreName()

Resolve the selected rate limiter store.

string
rateLimiterName()

Resolve the identity whose limits and cooldowns this resource uses.

bool
shouldWaitForRateLimits(AdmissionPolicy|Cooldown $policy, Decision $result)

Determine if a denied rate limit should be awaited.

string
resolveRateLimitCooldownKeyFor(PendingRequest $pendingRequest)

Resolve the stable cooldown key for an operation.

int|null
resolveRateLimitCooldownFor(Response $response)

Resolve the cooldown imposed by a response.

bool
rateLimitingEnabled(PendingRequest $pendingRequest)

Determine if this resource's rate limits apply to an operation.

array
resolveRateLimits(PendingRequest $pendingRequest)

Resolve the admission policies for an operation.

UnitEnum|string|null
resolveRateLimitStore()

Resolve the selected rate limiter store.

string
resolveRateLimiterName()

Resolve the identity whose limits and cooldowns this resource uses.

bool
waitForRateLimits(AdmissionPolicy|Cooldown $policy, Decision $result)

Determine if a denied rate limit should be awaited.

string
resolveRateLimitCooldownKey(PendingRequest $pendingRequest)

Resolve the stable cooldown key for an operation.

int|null
resolveRateLimitCooldown(Response $response)

Resolve the cooldown imposed by a response.

Details

at line 22
final bool usesRateLimits(PendingRequest $pendingRequest)

internal  
 

Determine if this resource's rate limits apply to an operation.

Parameters

PendingRequest $pendingRequest

Return Value

bool

at line 33
final array resolveRateLimitPolicies(PendingRequest $pendingRequest)

internal  
 

Resolve the admission policies for an operation.

Parameters

PendingRequest $pendingRequest

Return Value

array

at line 43
final UnitEnum|string|null resolveRateLimitStoreName()

internal  
 

Resolve the selected rate limiter store.

Return Value

UnitEnum|string|null

at line 53
final string rateLimiterName()

internal  
 

Resolve the identity whose limits and cooldowns this resource uses.

Return Value

string

at line 63
final bool shouldWaitForRateLimits(AdmissionPolicy|Cooldown $policy, Decision $result)

internal  
 

Determine if a denied rate limit should be awaited.

Parameters

AdmissionPolicy|Cooldown $policy
Decision $result

Return Value

bool

at line 73
final string resolveRateLimitCooldownKeyFor(PendingRequest $pendingRequest)

internal  
 

Resolve the stable cooldown key for an operation.

Parameters

PendingRequest $pendingRequest

Return Value

string

at line 83
final int|null resolveRateLimitCooldownFor(Response $response)

internal  
 

Resolve the cooldown imposed by a response.

Parameters

Response $response

Return Value

int|null

at line 91
protected bool rateLimitingEnabled(PendingRequest $pendingRequest)

Determine if this resource's rate limits apply to an operation.

Parameters

PendingRequest $pendingRequest

Return Value

bool

at line 101
abstract protected array resolveRateLimits(PendingRequest $pendingRequest)

Resolve the admission policies for an operation.

Parameters

PendingRequest $pendingRequest

Return Value

array

at line 106
protected UnitEnum|string|null resolveRateLimitStore()

Resolve the selected rate limiter store.

Return Value

UnitEnum|string|null

at line 117
protected string resolveRateLimiterName()

Resolve the identity whose limits and cooldowns this resource uses.

Resources that return the same name share limits and cooldowns within the same store, key scope and policy identity.

Return Value

string

at line 125
protected bool waitForRateLimits(AdmissionPolicy|Cooldown $policy, Decision $result)

Determine if a denied rate limit should be awaited.

Parameters

AdmissionPolicy|Cooldown $policy
Decision $result

Return Value

bool

at line 133
protected string resolveRateLimitCooldownKey(PendingRequest $pendingRequest)

Resolve the stable cooldown key for an operation.

Parameters

PendingRequest $pendingRequest

Return Value

string

at line 144
protected int|null resolveRateLimitCooldown(Response $response)

Resolve the cooldown imposed by a response.

Override this method to support a provider-specific response format or enforce a maximum duration defined by the provider.

Parameters

Response $response

Return Value

int|null