What is Action cable
Action Cable is a feature of the Ruby on Rails framework that provides real-time, bidirectional communication between a web server and its clients using WebSockets. It allows for the creation of dynamic, interactive user experiences by enabling real-time updates in the browser without the need for a page refresh.
Create a Client side channel subscription
Considering the above example, In the previous versions of Rails,
the connected method is called when the WebSockets connection is established, and the disconnected method is called when the connection is lost
Rails 7 has added the ability for subscribers to handle reconnections with the
connected() callback if they miss some messages due to a lost connection.
Check out the PR for more details.