Reasons to hate action cable

Hi all recently we got a task to integrate with a 3rd party api, get data and display on our site. It is taking 5-10 secs to get response from it. We went on trying ActionCable first as our backend is rails thinking that it gets us running without much integration hassle.

We ended up having bad experience with it. My recommendation is to not to go for ActionCable at any case. Rails community included this in Rails 5 but the client library is poorly written. As per this writing the Rails 5.2 also doesn’t have any updates to ActionCable.

Main Reasons:

  • Annoying Reconnections: ActionCable has this class called Connection which is used for authentication and establishing a connection. The client library has a connection monitoring pool which runs for every 3 secs.  There is no way to know why the server rejects the connection as it returns 1006(forceful disconnect). Still  the client continuously tries to establish the same connection again and again which is frustrating.
  • Not flexible: We look into ActionCable as a solution for websockets. Its just an option if you are using traditional Rails application (though it doesnt scale). It is so tightly coupled that we cant use it with any other websocket client library.

We ended up using Pusher which i discussed in this post.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.