aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/lib/action_cable/server/base.rb
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2016-02-25 14:31:19 +1030
committerMatthew Draper <matthew@trebex.net>2016-03-02 02:14:20 +1030
commit185c93eb0c8df629033be48e5eef431190c65226 (patch)
tree3c4896212c15aace270ef35bc5fb036c7c1c315a /actioncable/lib/action_cable/server/base.rb
parentd3c9d808e3e242155a44fd2a89ef272cfade8fe8 (diff)
downloadrails-185c93eb0c8df629033be48e5eef431190c65226.tar.gz
rails-185c93eb0c8df629033be48e5eef431190c65226.tar.bz2
rails-185c93eb0c8df629033be48e5eef431190c65226.zip
Use AS::Executor / AS::Reloader to support reloading in ActionCable
Diffstat (limited to 'actioncable/lib/action_cable/server/base.rb')
-rw-r--r--actioncable/lib/action_cable/server/base.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actioncable/lib/action_cable/server/base.rb b/actioncable/lib/action_cable/server/base.rb
index c3b64299e3..d9a2653cc2 100644
--- a/actioncable/lib/action_cable/server/base.rb
+++ b/actioncable/lib/action_cable/server/base.rb
@@ -33,6 +33,16 @@ module ActionCable
remote_connections.where(identifiers).disconnect
end
+ def restart
+ connections.each(&:close)
+
+ @mutex.synchronize do
+ worker_pool.halt if @worker_pool
+
+ @worker_pool = nil
+ end
+ end
+
# Gateway to RemoteConnections. See that class for details.
def remote_connections
@remote_connections || @mutex.synchronize { @remote_connections ||= RemoteConnections.new(self) }