简体   繁体   中英

What is Ruby on Rails Action Cable adapter?

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?

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM