Implementing Web Sockets in my app I've become confused which gem is better. I found plenty of different opportunities, however, some are hard to distinct.
Finally, I've chosen Action Cable (a Rails 5 native part) and Faye (appeared earlier and became very popular).
But now I'm stuck - is Action Cable the same thing as Faye? Which are differences (if there's any)?
1 What is Action Cable? Action Cable seamlessly integrates WebSockets with the rest of your Rails application. It allows for real-time features to be written in Ruby in the same style and form as the rest of your Rails application, while still being performant and scalable.
WebSocket is a protocol that allows bi-directional web communication between client and server, and Action Cable is the native Rails integration of this protocol. You can configure your application to communicate via Action Cable using the method below.
From the Faye website: Faye is a publish-subscribe messaging system based on the Bayeux protocol. It provides message servers for Node.js and Ruby, and clients for use on the server and in all major web browsers.
From the ActionCable readme: Action Cable seamlessly integrates WebSockets with the rest of your Rails application. It allows for real-time features to be written in Ruby in the same style and form as the rest of your Rails application, while still being performant and scalable. It's a full-stack offering that provides both a client-side JavaScript framework and a server-side Ruby framework. You have access to your full domain model written with Active Record or your ORM of choice.
Short answer is YES, both are pub/sub messaging system.
Long answer is NO, because faye is a low-level tool and ActionCable uses faye (look here), al least some components.
But you always can get the same results using (maybe) different efforts building an application using faye or ActionCable. The big difference is Faye works as a rack-based component instead of rails-based component.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With