diff options
author | Matthew Draper <matthew@trebex.net> | 2016-06-02 04:08:48 +0930 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2016-06-02 04:08:48 +0930 |
commit | a8df1bc345bf062e98bda64ef9638f65292c4b56 (patch) | |
tree | 84ee84e5f1bbfafa07b4598d6fa5f122b91e6fd4 /actioncable/lib/action_cable/server/base.rb | |
parent | 7b75ca100de247a40c78da89e28f4d71e0635b95 (diff) | |
download | rails-a8df1bc345bf062e98bda64ef9638f65292c4b56.tar.gz rails-a8df1bc345bf062e98bda64ef9638f65292c4b56.tar.bz2 rails-a8df1bc345bf062e98bda64ef9638f65292c4b56.zip |
Properly support reloading for Action Cable channels
Diffstat (limited to 'actioncable/lib/action_cable/server/base.rb')
-rw-r--r-- | actioncable/lib/action_cable/server/base.rb | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/actioncable/lib/action_cable/server/base.rb b/actioncable/lib/action_cable/server/base.rb index 717a60fe4f..0ad1e408a9 100644 --- a/actioncable/lib/action_cable/server/base.rb +++ b/actioncable/lib/action_cable/server/base.rb @@ -19,13 +19,13 @@ module ActionCable def initialize @mutex = Monitor.new - @remote_connections = @event_loop = @worker_pool = @channel_classes = @pubsub = nil + @remote_connections = @event_loop = @worker_pool = @pubsub = nil end # Called by Rack to setup the server. def call(env) setup_heartbeat_timer - config.connection_class.new(self, env).process + config.connection_class.call.new(self, env).process end # Disconnect all the connections identified by `identifiers` on this server or any others via RemoteConnections. @@ -67,16 +67,6 @@ module ActionCable @worker_pool || @mutex.synchronize { @worker_pool ||= ActionCable::Server::Worker.new(max_size: config.worker_pool_size) } end - # Requires and returns a hash of all of the channel class constants, which are keyed by name. - def channel_classes - @channel_classes || @mutex.synchronize do - @channel_classes ||= begin - config.channel_paths.each { |channel_path| require channel_path } - config.channel_class_names.each_with_object({}) { |name, hash| hash[name] = name.constantize } - end - end - end - # Adapter used for all streams/broadcasting. def pubsub @pubsub || @mutex.synchronize { @pubsub ||= config.pubsub_adapter.new(self) } @@ -84,7 +74,7 @@ module ActionCable # All of the identifiers applied to the connection class associated with this server. def connection_identifiers - config.connection_class.identifiers + config.connection_class.call.identifiers end end |