Unraveling the Cable: How ActionCable works
summary
Explains how Action Cable actually wires browsers to Rails: a browser opens a TCP connection, does the HTTP upgrade to 101 Switching Protocols, rack.hijack yields an IO socket, subscriptions flow over that socket, and broadcasts go through Redis Pub/Sub; shows concrete Ruby scripts and browser devtools traces. Claims websockets cut bandwidth overhead—about 80% was HTTP headers in one IoT use case—and demos a chatroom built with these pieces that successfully upgrades, subscribes, publishes, and delivers messages.
AI-written summary · about
chapters (12)
- 0:00Intro
- 0:35About Me
- 2:34Not magic, not really
- 4:57What even is Action Cable?
- 5:55Why use Action Cable?
- 8:49Action Cable Lifecycle
- 13:35Client connects to cable
- 20:40Rack Hijack
- 22:18Server confirms the connection
- 25:50Redis Pub/Sub
- 29:12How WebSockets Work
- 31:24Sending messages to client
related talks
37mUntangling cables and demystifying twisted transistors
39mActionCable for Not-Another-Chat-App-Please
38mAnycable - Universal Action Cable
28mReal-time collaboration with Rails
38mHigh Concurrent Ruby Web Development Without Fear
36mThe pitfalls of realtime-ification
28mReal-Time Rails
47mActionCable, Rails API and React - Modern Single Page Apps
