Title: Move server side after and every methods to include module · Issue #350 · hyperstack-org/hyperstack · GitHub
Open Graph Title: Move server side after and every methods to include module · Issue #350 · hyperstack-org/hyperstack
X Title: Move server side after and every methods to include module · Issue #350 · hyperstack-org/hyperstack
Description: Currently after and every methods are added to the Kernel module server side, so that Isomorphic Operations can use these methods uniformly on the server and client. The problem is other gems tend to also add these methods (especially af...
Open Graph Description: Currently after and every methods are added to the Kernel module server side, so that Isomorphic Operations can use these methods uniformly on the server and client. The problem is other gems tend ...
X Description: Currently after and every methods are added to the Kernel module server side, so that Isomorphic Operations can use these methods uniformly on the server and client. The problem is other gems tend ...
Opengraph URL: https://github.com/hyperstack-org/hyperstack/issues/350
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Move server side after and every methods to include module","articleBody":"Currently `after` and `every` methods are added to the `Kernel` module server side, so that Isomorphic Operations can use these methods uniformly on the server and client.\r\n\r\nThe problem is other gems tend to also add these methods (especially `after`) to the kernel. \r\n\r\nSo rather than add them to the `kernel` we should now add them to a module (`Hyperstack::AsyncSleep` as both instance and class methods.\r\n\r\nThen you can include them in Operation classes (or elsewhere) as needed. \r\n\r\nAlso making them class level methods on both the server and client, you can say `Hyperstack::AsyncSleep.after` or `.every` any place without doing the include. \r\n\r\nThis will be a breaking change, but the work around is to either update the classes that are using `after` or `every` on the server to include AsyncSleep, or it could be done globally (i.e. include it into Object.)\r\n\r\n```ruby\r\nmodule Hyperstack\r\n module AsyncSleep\r\n if RUBY_ENGINE == 'opal'\r\n def self.every(*args, \u0026block)\r\n every(*args, \u0026block)\r\n end\r\n\r\n def self.after(*args, \u0026block)\r\n after(*args, \u0026block)\r\n end\r\n else\r\n extend self\r\n\r\n def every(time, \u0026block)\r\n Thread.new { loop { sleep time; block.call } }\r\n end\r\n\r\n def after(time, \u0026block)\r\n Thread.new { sleep time; block.call }\r\n end\r\n end\r\n end\r\nend\r\n```","author":{"url":"https://github.com/catmando","@type":"Person","name":"catmando"},"datePublished":"2021-02-14T04:00:46.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/350/hyperstack/issues/350"}
| 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:c2b7fc43-83ea-7016-af17-26ad3d672d8d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E6B8:42ABE:13941A:19B3FF:6991D5EF |
| html-safe-nonce | 3a5e743b139c33efcfe07816f4ff3b27c340a28b45efd83242a903704ac1924b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNkI4OjQyQUJFOjEzOTQxQToxOUIzRkY6Njk5MUQ1RUYiLCJ2aXNpdG9yX2lkIjoiMTMwNDMxMjk1MzE2ODg0NDI3MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8d12448590ca0d93068070920d19d482d958e23e18495d5e062bbf37a220a9b1 |
| hovercard-subject-tag | issue:807883226 |
| 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/hyperstack-org/hyperstack/350/issue_layout |
| twitter:image | https://opengraph.githubassets.com/637b52f2f90f330ef2299d562cee51e5534327bfe57b59ed8ed873fee567e08d/hyperstack-org/hyperstack/issues/350 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/637b52f2f90f330ef2299d562cee51e5534327bfe57b59ed8ed873fee567e08d/hyperstack-org/hyperstack/issues/350 |
| og:image:alt | Currently after and every methods are added to the Kernel module server side, so that Isomorphic Operations can use these methods uniformly on the server and client. The problem is other gems tend ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | catmando |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/hyperstack-org/hyperstack git https://github.com/hyperstack-org/hyperstack.git |
| octolytics-dimension-user_id | 34562730 |
| octolytics-dimension-user_login | hyperstack-org |
| octolytics-dimension-repository_id | 145879576 |
| octolytics-dimension-repository_nwo | hyperstack-org/hyperstack |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 145879576 |
| octolytics-dimension-repository_network_root_nwo | hyperstack-org/hyperstack |
| 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 | 848bc6032dcc93a9a7301dcc3f379a72ba13b96e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width