diff options
author | Mike A. Owens <mike@filespanker.com> | 2015-08-24 13:35:59 -0400 |
---|---|---|
committer | Mike A. Owens <mike@filespanker.com> | 2015-08-24 13:46:41 -0400 |
commit | cf426a7ee680e8cd30a4b5afccf7e140537836f4 (patch) | |
tree | 0782fdca55758ae6e700b32ebbf6b935a9f3e655 /lib/action_cable/channel/periodic_timers.rb | |
parent | 6143352f8ffba303f0c7644be7573f6725554cb3 (diff) | |
download | rails-cf426a7ee680e8cd30a4b5afccf7e140537836f4.tar.gz rails-cf426a7ee680e8cd30a4b5afccf7e140537836f4.tar.bz2 rails-cf426a7ee680e8cd30a4b5afccf7e140537836f4.zip |
Use ActiveSupport::Callbacks for Channel subscription callbacks.
* Rely on AS::Callbacks for callback handling.
* Add before_subscribe, after_subscribe, before_unsubscribe and
after_unsubscribe convenience methods
* alias on_subscribe and on_unsubscribe to after_subscribe and
after_unsubscribe, respectively.
* Remove `subscribed` and `unsubscribed` from the callback chain:
these methods are now executed as the subject of the callbacks.
* Update portions of ActionCable to use the more specific
callback names.
Diffstat (limited to 'lib/action_cable/channel/periodic_timers.rb')
-rw-r--r-- | lib/action_cable/channel/periodic_timers.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/action_cable/channel/periodic_timers.rb b/lib/action_cable/channel/periodic_timers.rb index 9bdcc87aa5..25fe8e5e54 100644 --- a/lib/action_cable/channel/periodic_timers.rb +++ b/lib/action_cable/channel/periodic_timers.rb @@ -7,8 +7,8 @@ module ActionCable class_attribute :periodic_timers, instance_reader: false self.periodic_timers = [] - on_subscribe :start_periodic_timers - on_unsubscribe :stop_periodic_timers + after_subscribe :start_periodic_timers + after_unsubscribe :stop_periodic_timers end module ClassMethods @@ -38,4 +38,4 @@ module ActionCable end end end -end
\ No newline at end of file +end |