'How can I create a synced countdown with rails and actioncable?
I'm building an app where on a specific page there needs to be a countdown synced for all the connected clients. The countdown will start, pause and reset based on certain user inputs.
I started toying around with the idea of using ActionCable PeriodicTimer. Before fully committing with that, however, I wanted to explore the potential of building this with built-in hotwire features such as streams and broadcasts.
I started to look into concurrent-ruby and its TimerTask. It kind of works, however, it can be quite messy to maintain and debug.
Do you have any pointers?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
