diff options
Diffstat (limited to 'lib/action_cable/channel/base.rb')
-rw-r--r-- | lib/action_cable/channel/base.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/action_cable/channel/base.rb b/lib/action_cable/channel/base.rb index a3aa4df2ad..832c8cc314 100644 --- a/lib/action_cable/channel/base.rb +++ b/lib/action_cable/channel/base.rb @@ -67,7 +67,7 @@ module ActionCable def start_periodic_timers self.class.periodic_timers.each do |callback, options| @_active_periodic_timers << EventMachine::PeriodicTimer.new(options[:every]) do - connection.class.worker_pool.async.run_periodic_timer(self, callback) + worker_pool.async.run_periodic_timer(self, callback) end end end @@ -75,6 +75,11 @@ module ActionCable def stop_periodic_timers @_active_periodic_timers.each {|t| t.cancel } end + + def worker_pool + connection.worker_pool + end + end end |