ActionCable is Rails 5's new framework for building real-time features through websockets. It allows for two-way communication channels between clients and servers. Key components include Puma and Redis to handle connections and publish/subscribe, and Channels which connect websocket streams to publish messages. ActionCable can power features like chat, feeds, and collaborative software that require real-time updates through JSON-encoded requests and responses.
2. What is ActionCable?
Framework for real-time communication
Integrates websockets with the rest of your
Rails application
Full stack offering with client side JS & server
side Ruby
It’s Rails 5 new hotness
3. Why Does ActionCable Exist?
Demand for push notifications & real-time
features
Lack of out-of-box support for websockets
Because Basecamp
4. The Moving Parts /
What You Need To Know
Puma
Redis
Websockets
Channels
Cable
7. Websockets
Full duplex connections over single TCP
connection
Simultaneous upstream and downstream
connections
The special sauce behind push notifications &
real-time features
Rails 5 - now with websockets!
8. Channels
This is where the PubSub magic happens
Channels are the publisher
Connections are the subscriber
Channels will connect the websocket’s stream
9. Blah Blah Blah...Why The Hell Does
This All Matter!??!?!?!??!?
It’s more than just new hotness
It’s the future of streaming websockets in
Rails
It will fill the void for real-time features that
has been lacking in Rails
10. What Can I Do With It?
Anything that requires a real-time stream
Chat
Feeds
API calls
Financial data
Collaborative software
Anything that requires JSON encoded requests