KnpLabs / KnpLabs/php-github-api
Feature idea - throttling rate limiter plugin
- Lenguaje dominante
- PHP
- Estrellas
- 2.2k
- Forks
- 587
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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);
}
}
```
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- php
- Área
- api
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100