KnpLabs / KnpLabs/php-github-api
Feature idea - throttling rate limiter plugin
- Langage dominant
- PHP
- Étoiles
- 2.2k
- Forks
- 587
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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);
}
}
```
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- php
- Domaine
- api
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 25/100