Changing `ActionView._deque.maxlen` in subclasses
还没有人认领这个 Issue。
评估
调研方向
首先阅读 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 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
labthings/python-labthings 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 35/100
labthings/python-labthings#324 ·
-
难度 5/5 一周以上 新手友好度 20/100
labthings/python-labthings#323 · 3 条评论 ·
-
难度 5/5 一周以上 新手友好度 15/100
labthings/python-labthings#302 · 2 条评论 ·
-
难度 5/5 一周以上 新手友好度 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 ·