Title: Changing `ActionView._deque.maxlen` in subclasses · Issue #300 · labthings/python-labthings · GitHub
Open Graph Title: Changing `ActionView._deque.maxlen` in subclasses · Issue #300 · labthings/python-labthings
X Title: Changing `ActionView._deque.maxlen` in subclasses · Issue #300 · labthings/python-labthings
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...
Open Graph 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...
X 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...
Opengraph URL: https://github.com/labthings/python-labthings/issues/300
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Changing `ActionView._deque.maxlen` in subclasses ","articleBody":"**Is your feature request related to a problem? Please describe.**\r\nI tried to lower the length of the ActionView _deque but could not find a way that would not result in a bug\r\n\r\n\r\n**Describe the solution you'd like**\r\n\r\nI would like to have a method to specify the ActionView queue length, ideally at the subclass definition level.\r\n\r\n**Describe alternatives you've considered**\r\nI tried:\r\n1. Changing the class attribute\r\n\r\n```python\r\nclass MyAction(ActionView):\r\n args = {\r\n \"averages\": fields.Integer(\r\n missing=20,\r\n example=20,\r\n description=\"Number of images to average over\",\r\n )\r\n }\r\n # Marshal the response as a string representation of the array\r\n schema = fields.String()\r\n _deque = Deque(maxlen=10)\r\n ...\r\n```\r\nI believe this is rendered useless by the `__init_subclass__` method.\r\n\r\n\r\n2. Overwritting the `_deque` at init:\r\n\r\n```python\r\nclass MyAction(ActionView):\r\n args = {\r\n \"averages\": fields.Integer(\r\n missing=20,\r\n example=20,\r\n description=\"Number of images to average over\",\r\n )\r\n }\r\n # Marshal the response as a string representation of the array\r\n schema = fields.String()\r\n def __init__(self, *args, **kwargs):\r\n super().__init__(*args, **kwargs)\r\n self._deque = Deque(maxlen=10)\r\n ...\r\n```\r\nThis solution is causing the request to hang.\r\n\r\n\r\nI also tried subclassing `__init_subclass__` (?) but to no avail.\r\n\r\nThanks again for your work, sorry for the spam today :)","author":{"url":"https://github.com/glyg","@type":"Person","name":"glyg"},"datePublished":"2021-11-26T15:06:19.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/300/python-labthings/issues/300"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:099460b0-52df-f873-a94e-bf15574af25e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E0AE:7D624:98FECF:C4068E:698FD5BF |
| html-safe-nonce | f1786bf84f3cbc444104ee06fbcbae8b0e2e8e7c32030d8bb8985502300261e6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMEFFOjdENjI0Ojk4RkVDRjpDNDA2OEU6Njk4RkQ1QkYiLCJ2aXNpdG9yX2lkIjoiNDMyMTk0Mzk3MDE3NzM0MDg2NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 901fc527ccd250ebb719cb557b31f948a0c8dc8c4b1860d91f9b080c21acc5d6 |
| hovercard-subject-tag | issue:1064579542 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/labthings/python-labthings/300/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fd542422230dcf4a1a49e85b5eb82c799d00a2fa3a2cd6a97720c8a354780951/labthings/python-labthings/issues/300 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fd542422230dcf4a1a49e85b5eb82c799d00a2fa3a2cd6a97720c8a354780951/labthings/python-labthings/issues/300 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | glyg |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/labthings/python-labthings git https://github.com/labthings/python-labthings.git |
| octolytics-dimension-user_id | 58913024 |
| octolytics-dimension-user_login | labthings |
| octolytics-dimension-repository_id | 234552142 |
| octolytics-dimension-repository_nwo | labthings/python-labthings |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 234552142 |
| octolytics-dimension-repository_network_root_nwo | labthings/python-labthings |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d320682233dfd4d28c0b30554a564c2fcd229032 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width