-
-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add broadcast_periodic method #89
Comments
I'm excited about it, but I admit I don't currently know exactly how you're proposing this could work. What I've always wanted is a way to kick off a thread or worker process that can fire code on a regular or scheduled basis, whether it be heartbeats or something else. You and @marcoroth have previously suggested that Ractors could help with this, but the implications of that assertion are sadly still beyond my understanding. My enthusiasm for the PeriodicTimers functionality was that it seemed like perhaps a way to make a heartbeat-like functionality possible, sooner. |
I admit I haven't yet looked at how or where this is implemented. I guess you can use this on your channel, which is persistent by default, and just transmit a partial every few seconds. I'm thinking about everything that polls external services: dashboards, ... |
If done correctly, this period timer could be useful in one of the wishlist items I shared in stimulusreflex/futurism#64 |
I've continued to think about this all day. My current leaning is towards documenting it as a pattern, but I'm not currently able to picture it being a part of the API surface. It's more like what's needed is someone to show the world how to kick ass using it? |
I'll try to concoct something after the holidays. I think this is difficult to reason about unless you have your head in it and an actual use case to test. But I think a first class implementation would open many doors. @hopsoft ? |
@leastbad brought this to our attention in Discord: https://api.rubyonrails.org/classes/ActionCable/Channel/PeriodicTimers/ClassMethods.html
I think it could be nice to shim this in CableReady so you can easily provide periodic updates.
Could be out of scope but I can instantly think of at least a handful cases where I could make good use of it.
The text was updated successfully, but these errors were encountered: