通过 RoR 动作电缆导轨查看http://edgeguides.rubyonrails.org/action_cable_overview.html#subscription-adapter http://edgeguides.rubyonrails.org/action_cable_overview.html#subscription-adapter,没有找到太多关于行动电缆适配器的信息。
development:
adapter: async
test:
adapter: async
production:
adapter: redis
url: redis://10.10.3.153:6381
你能解释一下什么是async适配器以及为什么我需要redis作为适配器在生产中?
async
适配器是一个异步版本inline
适配器,它将 pubs/subs 存储在 Rails 实例的内存中,因此如果给定实例被杀死,所有数据都将丢失。出于同样的原因,它不可扩展。
Rails 推荐使用 Redis,因为它比 PostgreSQL 快得多。
如果您真的想知道所有订阅适配器如何工作,您可以查看他们的源代码 https://github.com/rails/rails/tree/master/actioncable/lib/action_cable/subscription_adapter.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)