aboutsummaryrefslogtreecommitdiffstats
path: root/lib/action_cable/channel
diff options
context:
space:
mode:
Diffstat (limited to 'lib/action_cable/channel')
-rw-r--r--lib/action_cable/channel/base.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/action_cable/channel/base.rb b/lib/action_cable/channel/base.rb
index c18593bf6f..8580f9d75b 100644
--- a/lib/action_cable/channel/base.rb
+++ b/lib/action_cable/channel/base.rb
@@ -56,11 +56,9 @@ module ActionCable
send(callback)
end
end
-
- def run_unsubscribe_callbacks
- self.class.on_unsubscribe_callbacks.each do |callback|
- send(callback)
- end
+ def perform_disconnection
+ run_unsubscribe_callbacks
+ logger.info "#{self.class.name} disconnected"
end
protected
@@ -89,6 +87,11 @@ module ActionCable
end
end
+ private
+ def run_unsubscribe_callbacks
+ self.class.on_unsubscribe_callbacks.each { |callback| send(callback) }
+ end
+
def start_periodic_timers
self.class.periodic_timers.each do |callback, options|
@_active_periodic_timers << EventMachine::PeriodicTimer.new(options[:every]) do