Changing `ActionView._deque.maxlen` in subclasses
まだ誰も着手していません。
評価
調査の方向性
まず ActionView の実装、特に init_subclass と _deque の初期化経路を読みます。issue にあるサブクラスの例を再現し、リクエスト処理でキューがどのように使われているかを調べます。実装では、リクエストをハングさせずにサブクラスレベルでサポートされるキュー長を提供し、設定された最大値をカバーするテストを含める必要があります。
索引モデルが issue の本文から書いたものです。
説明
Is your feature request related to a problem? Please describe.
I tried to lower the length of the ActionView _deque but could not find a way that would not result in a bug
Describe the solution you'd like
I would like to have a method to specify the ActionView queue length, ideally at the subclass definition level.
Describe alternatives you've considered
I tried:
- Changing the class attribute
class MyAction(ActionView):
args = {
"averages": fields.Integer(
missing=20,
example=20,
description="Number of images to average over",
)
}
# Marshal the response as a string representation of the array
schema = fields.String()
_deque = Deque(maxlen=10)
...
I believe this is rendered useless by the __init_subclass__ method.
- Overwritting the
_dequeat init:
class MyAction(ActionView):
args = {
"averages": fields.Integer(
missing=20,
example=20,
description="Number of images to average over",
)
}
# Marshal the response as a string representation of the array
schema = fields.String()
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._deque = Deque(maxlen=10)
...
This solution is causing the request to hang.
I also tried subclassing __init_subclass__ (?) but to no avail.
Thanks again for your work, sorry for the spam today :)
- 主要言語
- Python
- スター
- 19
- フォーク
- 2
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
labthings/python-labthings のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
labthings/python-labthings#324 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
labthings/python-labthings#323 · コメント 3 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
labthings/python-labthings#302 · コメント 2 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
labthings/python-labthings#237 · コメント 3 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
labthings/python-labthings の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
canonical/paas-charm#368 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
tech debt
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
StevenBlack/hosts#3256 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
qualcomm/qai-appbuilder#275 ·