Changing `ActionView._deque.maxlen` in subclasses
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
Hướng nghiên cứu
Bắt đầu bằng cách đọc phần triển khai của ActionView, đặc biệt là init_subclass và đường dẫn khởi tạo _deque. Tái hiện các ví dụ về lớp con trong issue và kiểm tra cách việc xử lý request sử dụng hàng đợi. Phần triển khai cần cung cấp độ dài hàng đợi được hỗ trợ ở cấp lớp con mà không làm các request bị treo, với các bài kiểm thử bao phủ giá trị tối đa đã cấu hình.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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 :)
- Ngôn ngữ chính
- Python
- Star
- 19
- Fork
- 2
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của labthings/python-labthings
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
labthings/python-labthings#324 ·
-
Updating dependencies... Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
labthings/python-labthings#323 · 3 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
labthings/python-labthings#302 · 2 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
labthings/python-labthings#237 · 3 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Tất cả issue của labthings/python-labthings
Issue tương tự
-
essnmx good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
[Feature] 奇物选择添加优先级 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
syfoud/Simulated_Scepter#174 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Giskard-AI/giskard-oss#2840 · 1 bình luận ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Đang mởarea: repo bug perceived difficulty: 2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
yeti-platform/yeti#1380 ·