Add smart Rate Limiter
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
リンクされている同期および非同期の組み込み retry handler から始め、次に Java SDK の rate-limit ガイドと比較します。要求された動作を Web API、Webhook、Audit Logs、SCIM の各クライアントに対応付けます。完了条件は、オプトインで有効化できるトラフィック制御レイヤーが同期および非同期クライアントをサポートし、拡張可能なメトリクスストレージを備え、asyncio アプリでブロッキングする sleep を行わないことです。
索引モデルが issue の本文から書いたものです。
説明
Now that we have a built-in retry handler for rate limited errors in v3.9, retrying a request after getting rate-limited is much easier than before.
- https://github.com/slackapi/python-slack-sdk/releases/tag/v3.9.0
- https://github.com/slackapi/python-slack-sdk/blob/v3.9.1/slack_sdk/http_retry/builtin_handlers.py#L52-L91
- https://github.com/slackapi/python-slack-sdk/blob/v3.9.1/slack_sdk/http_retry/builtin_async_handlers.py#L49-L88
However, getting rate-limited results in a much longer execution time as the whole operation. As a solution for this pain point, we will add a built-in traffic control layer like we do in the Java SDK: https://slack.dev/java-slack-sdk/guides/web-api-basics#rate-limits
A few points to consider for implementing this feature:
- The module manages the amount of requests in the last minute and calculate the interval before the next API call
- Metrics data can be in memory in most use cases but the part should be extensible to switch to other data storage (e.g., Redis)
- As we do in the Java SDK, running the same script/app in multiple hosts should be supported.
- For backward-compatibility, we don't turn the feature on by default. Users can enable it only when they want it.
- Both sync and async API clients should be supported in a proper way (= don't use
time.sleepin asyncio apps) - All API clients (Web API, Audit Logs, SCIM, Webhook) should have the functionality.
Category (place an x in each of the [ ])
- slack_sdk.web.WebClient (sync/async) (Web API client)
- slack_sdk.webhook.WebhookClient (sync/async) (Incoming Webhook, response_url sender)
- slack_sdk.models (UI component builders)
- slack_sdk.oauth (OAuth Flow Utilities)
- slack_sdk.socket_mode (Socket Mode client)
- slack_sdk.audit_logs (Audit Logs API client)
- slack_sdk.scim (SCIM API client)
- slack_sdk.rtm (RTM client)
- slack_sdk.signature (Request Signature Verifier)
Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
- 主要言語
- Python
- スター
- 4k
- フォーク
- 857
- 平均マージ
- 22時間 21分
- マージ済み PR(30日)
- 16
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
slackapi/python-slack-sdk のほかの issue
-
needs info server-side-issue
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
slackapi/python-slack-sdk#1961 · コメント 3 件 ·
-
Use logger.isEnabledFor(logging.DEBUG) instead of logger.level <= logging.DEBUG for debug guards オープンauto-triage-skip bug
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
slackapi/python-slack-sdk#1957 ·
-
auto-triage-skip discussion
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
slackapi/python-slack-sdk#1940 · コメント 2 件 ·
-
chat_postMessage silently forwards thread_id to the API, so a threaded reply posts to the channel オープンauto-triage-skip enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
slackapi/python-slack-sdk#1923 · コメント 2 件 ·
-
auto-triage-skip bug socket-mode
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
slackapi/python-slack-sdk#1922 · コメント 2 件 ·
slackapi/python-slack-sdk の issue をすべて見る
似ている issue
-
bug confirmed issue
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
open-webui/open-webui#30750 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 90/100