diff options
author | Vladimir Dementyev <dementiev.vm@gmail.com> | 2018-12-14 16:46:39 -0500 |
---|---|---|
committer | Vladimir Dementyev <dementiev.vm@gmail.com> | 2019-02-12 17:17:46 -0500 |
commit | 3cd69fa2c025da1cc45b1b9b43b227cceb025837 (patch) | |
tree | acd23f3be831673cb04a49ef847aff6876c47c57 /actioncable/lib | |
parent | 7432e251873690234d0d288e8eb009fbee80b635 (diff) | |
download | rails-3cd69fa2c025da1cc45b1b9b43b227cceb025837.tar.gz rails-3cd69fa2c025da1cc45b1b9b43b227cceb025837.tar.bz2 rails-3cd69fa2c025da1cc45b1b9b43b227cceb025837.zip |
Allow passing custom config to ActionCable::Server::Base
That allows us to create a separate, isolated Action Cable server
instance within the same app.
Diffstat (limited to 'actioncable/lib')
-rw-r--r-- | actioncable/lib/action_cable/server/base.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/actioncable/lib/action_cable/server/base.rb b/actioncable/lib/action_cable/server/base.rb index 2b9e1cba3b..98b3743175 100644 --- a/actioncable/lib/action_cable/server/base.rb +++ b/actioncable/lib/action_cable/server/base.rb @@ -12,14 +12,17 @@ module ActionCable include ActionCable::Server::Broadcasting include ActionCable::Server::Connections - cattr_accessor :config, instance_accessor: true, default: ActionCable::Server::Configuration.new + cattr_accessor :config, instance_accessor: false, default: ActionCable::Server::Configuration.new + + attr_reader :config def self.logger; config.logger; end delegate :logger, to: :config attr_reader :mutex - def initialize + def initialize(config: self.class.config) + @config = config @mutex = Monitor.new @remote_connections = @event_loop = @worker_pool = @pubsub = nil end |