Handler
in package
AbstractYes
Table of Contents
Constants
- DEFAULT_RETRY_AFTER = 60
- RATE_LIMIT_CACHE_KEY = 'discogs_rate_limit'
Properties
Methods
- __construct() : mixed
- canMakeRequest() : bool
- Check if we can make a Discogs request (not rate limited)
- getRateLimitStatus() : array<string|int, mixed>
- Get rate limit status information
- fetchEndpoint() : array<string|int, mixed>|null
- fetchEndpointAsync() : PromiseInterface
- handleRateLimit() : void
Constants
DEFAULT_RETRY_AFTER
private
mixed
DEFAULT_RETRY_AFTER
= 60
RATE_LIMIT_CACHE_KEY
private
mixed
RATE_LIMIT_CACHE_KEY
= 'discogs_rate_limit'
Properties
$baseUrl read-only
protected
string
$baseUrl
$client read-only
protected
Client
$client
Methods
__construct()
public
__construct(Client $client, string $baseUrl) : mixed
Parameters
- $client : Client
- $baseUrl : string
canMakeRequest()
Check if we can make a Discogs request (not rate limited)
public
canMakeRequest() : bool
Return values
boolgetRateLimitStatus()
Get rate limit status information
public
getRateLimitStatus() : array<string|int, mixed>
Return values
array<string|int, mixed>fetchEndpoint()
protected
fetchEndpoint(string $endpoint[, array<string|int, mixed> $params = [] ]) : array<string|int, mixed>|null
Parameters
- $endpoint : string
- $params : array<string|int, mixed> = []
Return values
array<string|int, mixed>|nullfetchEndpointAsync()
protected
fetchEndpointAsync(string $endpoint[, array<string|int, mixed> $params = [] ]) : PromiseInterface
Parameters
- $endpoint : string
- $params : array<string|int, mixed> = []
Return values
PromiseInterfacehandleRateLimit()
private
handleRateLimit(string $endpoint, int $retryAfter, string $rateLimitRemaining) : void
Parameters
- $endpoint : string
- $retryAfter : int
- $rateLimitRemaining : string