KnpLabs / KnpLabs/php-github-api
Feature idea - throttling rate limiter plugin
- Lingua principale
- PHP
- Stelle
- 2.2k
- Fork
- 587
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Something like this would come in handy:
```php
client = $client;
}
public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise
{
$path = $request->getUri()->getPath();
if ($path === '/rate_limit') {
return $next($request);
}
/** @var RateLimitResource $resource */
$resource = $this->client->api('rate_limit')->getResource('core');
if ($resource->getRemaining() < 10) {
$reset = $resource->getReset();
$sleepFor = $reset - time();
if ($sleepFor > 0) {
sleep($sleepFor);
}
}
return $next($request);
}
}
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
The issue names Client, RateLimitResource, and the Plugin request-handling methods, but no repository files, tests, or acceptance criteria. Start by locating those entry points and clarify the supported thresholds, waiting behavior, and test expectations; the issue does not define what completion looks like.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- php
- Ambito
- api
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100