Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Ruby on Rails Action Cable adapter?

Tags:

looking through RoR action cable guide http://edgeguides.rubyonrails.org/action_cable_overview.html#subscription-adapter , didn't found much information about action cable adapter.

development:
  adapter: async

test:
  adapter: async

production:
  adapter: redis
  url: redis://10.10.3.153:6381

Could you explain what is async adapter and why do I need redis in production as adapter?

like image 902
divideByZero Avatar asked Oct 09 '16 20:10

divideByZero


1 Answers

async adapter is an asynchronous version of an inline adapter, which stores pubs/subs in the memory of a Rails instance, therefore all data will be lost if given instance is killed. For the same reason it is not scalable.

Rails recommends Redis because it's way faster than PostgreSQL.

If you really wonder how do all subscription adapters work, you can check out their source code.

like image 196
Viktor Avatar answered Sep 22 '22 12:09

Viktor