Bånder

Handler
in package

AbstractYes

Table of Contents

Constants

BACKOFF_AFTER_503  = 2
LOCK_TIMEOUT  = 5
RATE_LIMIT_CACHE_KEY  = 'musicbrainz_last_request'
RATE_LIMIT_INTERVAL  = 1
RATE_LIMIT_LOCK_KEY  = 'musicbrainz_request_lock'

Properties

$baseUrl  : string
$client  : Client

Methods

__construct()  : mixed
fetchEndpoint()  : array<string|int, mixed>|null
enforceRateLimit()  : void
Enforce MusicBrainz rate limit of 1 request per second per IP

Constants

BACKOFF_AFTER_503

private mixed BACKOFF_AFTER_503 = 2

LOCK_TIMEOUT

private mixed LOCK_TIMEOUT = 5

RATE_LIMIT_CACHE_KEY

private mixed RATE_LIMIT_CACHE_KEY = 'musicbrainz_last_request'

RATE_LIMIT_INTERVAL

private mixed RATE_LIMIT_INTERVAL = 1

RATE_LIMIT_LOCK_KEY

private mixed RATE_LIMIT_LOCK_KEY = 'musicbrainz_request_lock'

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

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

enforceRateLimit()

Enforce MusicBrainz rate limit of 1 request per second per IP

private enforceRateLimit() : void

        
On this page

Search results