KnpLabs / KnpLabs/php-github-api

Feature idea - throttling rate limiter plugin

オープン
#973 コメント 0 件 リアクション 4 件 担当者 0 名 GitHub で見る
feature-request good first issue
主要言語
PHP
スター
2.2k
フォーク
587
PR マージ指標
30日以内にマージされた PR はありません

説明

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);
}

}

```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
php
領域
api
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。