diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-01-18 00:01:10 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-18 00:01:10 -0500 |
commit | b19c2216a9f25512ed60ae6047852cd6506c094a (patch) | |
tree | 96cff51bc0e1d449a8415227f6a6ce9fe7d08c35 /guides | |
parent | 0196704d26eed52c7da733db9cdeca6b1b4c7e8c (diff) | |
parent | f18d1e1e52c3163f0bcd1ca2adde1ff84e44830c (diff) | |
download | rails-b19c2216a9f25512ed60ae6047852cd6506c094a.tar.gz rails-b19c2216a9f25512ed60ae6047852cd6506c094a.tar.bz2 rails-b19c2216a9f25512ed60ae6047852cd6506c094a.zip |
Merge pull request #27719 from matrix9180/action_cable_docs_update
[WIP] Update ActionCable guide to better describe SubscriptionAdapter config
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/action_cable_overview.md | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/guides/source/action_cable_overview.md b/guides/source/action_cable_overview.md index 319277ef68..ff21319c8a 100644 --- a/guides/source/action_cable_overview.md +++ b/guides/source/action_cable_overview.md @@ -240,8 +240,8 @@ WebNotificationsChannel.broadcast_to( ``` The `WebNotificationsChannel.broadcast_to` call places a message in the current -subscription adapter (by default `redis` for production and `async` for development and -test environments)'s pubsub queue under a separate broadcasting name for each user. +subscription adapter (by default `redis` for production and `async` for development and +test environments)'s pubsub queue under a separate broadcasting name for each user. For a user with an ID of 1, the broadcasting name would be `web_notifications:1`. The channel has been instructed to stream everything that arrives at @@ -530,7 +530,7 @@ Action Cable has two required configurations: a subscription adapter and allowed ### Subscription Adapter By default, Action Cable looks for a configuration file in `config/cable.yml`. -The file must specify an adapter and a URL for each Rails environment. See the +The file must specify an adapter for each Rails environment. See the [Dependencies](#dependencies) section for additional information on adapters. ```yaml @@ -543,7 +543,26 @@ test: production: adapter: redis url: redis://10.10.3.153:6381 + channel_prefix: appname_production ``` +#### Adapter Configuration + +##### Async Adapter + +The async adapter is intended for development/testing and should not be used in production. + +##### Redis Adapter + +The Redis & Evented Redis adapters require a url pointing to the Redis server. Additionally, +a channel_prefix may be provided to avoid channel name collisions when using the same Redis server. +server for multiple applications. See the [Redis PubSub documentation](https://redis.io/topics/pubsub#database-amp-scoping) for more details. + +See the +[Dependencies](#dependencies) section for additional information on adapters. + +##### PostgreSQL adapter + +The postgres adapter will use the ActiveRecord connection pool for it's connection. This may change in the future. [#27214](https://github.com/rails/rails/issues/27214) ### Allowed Request Origins |