Bånder

Handler
in package

AbstractYes

Table of Contents

Constants

DEFAULT_RETRY_AFTER  = 60
RATE_LIMIT_CACHE_KEY  = 'discogs_rate_limit'

Properties

$baseUrl  : string
$client  : Client

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
bool

getRateLimitStatus()

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>|null

fetchEndpointAsync()

protected fetchEndpointAsync(string $endpoint[, array<string|int, mixed> $params = [] ]) : PromiseInterface
Parameters
$endpoint : string
$params : array<string|int, mixed> = []
Return values
PromiseInterface

handleRateLimit()

private handleRateLimit(string $endpoint, int $retryAfter, string $rateLimitRemaining) : void
Parameters
$endpoint : string
$retryAfter : int
$rateLimitRemaining : string

        
On this page

Search results