From 3cd69fa2c025da1cc45b1b9b43b227cceb025837 Mon Sep 17 00:00:00 2001 From: Vladimir Dementyev Date: Fri, 14 Dec 2018 16:46:39 -0500 Subject: Allow passing custom config to ActionCable::Server::Base That allows us to create a separate, isolated Action Cable server instance within the same app. --- actioncable/CHANGELOG.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'actioncable/CHANGELOG.md') diff --git a/actioncable/CHANGELOG.md b/actioncable/CHANGELOG.md index 42edbd6954..3ce35edbb8 100644 --- a/actioncable/CHANGELOG.md +++ b/actioncable/CHANGELOG.md @@ -1,3 +1,26 @@ +* Allow passing custom configuration to `ActionCable::Server::Base`. + + You can now create a standalone Action Cable server with a custom configuration + (e.g. to run it in isolation from the default one): + + ```ruby + config = ActionCable::Server::Configuration.new + config.cable = { adapter: "redis", channel_prefix: "custom_" } + + CUSTOM_CABLE = ActionCable::Server::Base.new(config: config) + ``` + + Then you can mount it in the `routes.rb` file: + + ```ruby + Rails.application.routes.draw do + mount CUSTOM_CABLE => "/custom_cable" + # ... + end + ``` + + *Vladimir Dementyev* + * Add `:action_cable_connection` and `:action_cable_channel` load hooks. You can use them to extend `ActionCable::Connection::Base` and `ActionCable::Channel::Base` -- cgit v1.2.3