Title: Rework shared memory · Issue #54 · python-botogram/botogram · GitHub
Open Graph Title: Rework shared memory · Issue #54 · python-botogram/botogram
X Title: Rework shared memory · Issue #54 · python-botogram/botogram
Description: The current status of shared memory is a real mess, and I really need to solve it: First of all, you can't easily use sub-dictionaries because they're not synchronized, and you need to do something like this, which is really ugly: mydata...
Open Graph Description: The current status of shared memory is a real mess, and I really need to solve it: First of all, you can't easily use sub-dictionaries because they're not synchronized, and you need to do something...
X Description: The current status of shared memory is a real mess, and I really need to solve it: First of all, you can't easily use sub-dictionaries because they're not synchronized, and you need to do s...
Opengraph URL: https://github.com/python-botogram/botogram/issues/54
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Rework shared memory","articleBody":"The current status of shared memory is a real mess, and I really need to solve it:\n\nFirst of all, you can't easily use sub-dictionaries because they're not synchronized, and you need to do something like this, which is really ugly:\n\n``` python\nmydata = shared[\"mydata\"]\nmydata[\"test\"] = \"abc\"\nshared[\"mydata\"] = mydata\n```\n\nOther than that, shared memory is directly available via the `shared` argument of any hook: this might seem convenient, but prevents adding more shared things, like a global memory (as requested in #22) and locks, which are currently implemented by adding the method at runtime.\n\nIn order to solve this problems, and allowing to create custom drivers more easily, a big rewrite of the whole thing is needed. The new API I want for it is:\n\n``` python\n# For a component's memory\nshared.memory[\"mydata\"] = shared.object(\"dict\")\nshared.memory[\"mydata\"][\"test\"] = \"yay\"\nwith shared.lock(\"hello\"):\n pass\n\n# A custom bucket\nbucket = bot.shared.bucket(\"test\")\nbucket.memory[\"mydata\"] = \"test\n```\n\n---\n- [x] Move the functionality of `shared` into `shared.memory`\n- [ ] Use a custom proxy instead of the multiprocessing one, so it's easier to write custom drivers and the API is consistent between them\n - [x] Add basic support for objects management\n - [x] Add ability to export/import objects and switch drivers\n - [x] Add ability to add memory preparers\n - [ ] Add support for the runner driver\n- [ ] Add some sort of garbage collection\n","author":{"url":"https://github.com/emilyalbini","@type":"Person","name":"emilyalbini"},"datePublished":"2016-04-10T17:55:52Z","url":"https://github.com/python-botogram/botogram/issues/54"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| 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:4ed0d477-f1f6-4bd9-bcb6-5bf459708a0b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AF26:346B7E:F250:15167:6AEC7EC2 |
| html-safe-nonce | 1738d06bec9f6bf97760d7842aeaa6799a34afda0daba70978959b146eaf811b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjI2OjM0NkI3RTpGMjUwOjE1MTY3OjZBRUM3RUMyIiwidmlzaXRvcl9pZCI6IjE2OTExMTYzMzc3NzQ3NTU1MjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3425730c9336f8d976cd23d27fa252ae566ebb24310404e14a224225aed8fedc |
| hovercard-subject-tag | issue:147247032 |
| 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/python-botogram/botogram/54/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6b21bd5cc7f23c8b48c79f27dc60fff62a3807251edf666c30ad0109abfd3271/python-botogram/botogram/issues/54 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6b21bd5cc7f23c8b48c79f27dc60fff62a3807251edf666c30ad0109abfd3271/python-botogram/botogram/issues/54 |
| og:image:alt | The current status of shared memory is a real mess, and I really need to solve it: First of all, you can't easily use sub-dictionaries because they're not synchronized, and you need to do something... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | emilyalbini |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2bdf579c3278a003eb7fd86a77e2ed31e813bf4e18e5958458d2bdc3941566b0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-botogram/botogram git https://github.com/python-botogram/botogram.git |
| octolytics-dimension-user_id | 38258752 |
| octolytics-dimension-user_login | python-botogram |
| octolytics-dimension-repository_id | 38007898 |
| octolytics-dimension-repository_nwo | python-botogram/botogram |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 38007898 |
| octolytics-dimension-repository_network_root_nwo | python-botogram/botogram |
| 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 | 22d3a69d3307500eb5a7909970fc0d9a7735cb70 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width