Changing `ActionView._deque.maxlen` in subclasses
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
Research direction
Start by reading the ActionView implementation, especially init_subclass and the _deque initialization path. Reproduce the subclass examples from the issue and inspect how request handling uses the queue. Done should provide a supported subclass-level queue length without hanging requests, with tests covering the configured maximum.
Written by the indexing model from the issue text.
Description
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 :)
- Dominant language
- Python
- Stars
- 19
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from labthings/python-labthings
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
labthings/python-labthings#324 ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
labthings/python-labthings#323 · 3 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
labthings/python-labthings#302 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
labthings/python-labthings#237 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
All issues in labthings/python-labthings
Similar issues
-
agent-ready documentation needs-triage
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
instance instance add
Difficulty 1/5 Under an hour Newbie friendliness 72/100
searxng/searx-instances#939 · 1 comment ·
-
area-deployment area-integrations triage:bot-seen
Difficulty 2/5 Half a day Newbie friendliness 86/100