...

/

Introduction to ActionCable

Introduction to ActionCable

Learn about immediate communication with ActionCable.

Background

In the last chapter, we learned how to communicate with the server using regular HTTP requests and receiving either HTML or JSON in response. One feature of our server interactions in both Stimulus and React is that we are simulating a real-time connection with the server by polling the server repeatedly.

Problems with polling

Polling this way has some potential drawbacks. That is, there’s some extra overhead to make all the HTTP calls locally and querying the server often can have negative performance implications.

WebSocket protocol

An alternative for client-server ...