Class: CableRoom::PeriodicTimer
- Inherits:
-
Object
- Object
- CableRoom::PeriodicTimer
- Defined in:
- lib/cable_room/channel_base.rb
Overview
ActionCable's stop_periodic_timers calls #shutdown on whatever #start_periodic_timer
returned, but Rufus jobs are cancelled with #unschedule. Adapt the one to the other here
rather than aliasing #shutdown onto Rufus::Scheduler::Job for the whole process.
Instance Attribute Summary collapse
-
#job ⇒ Object
readonly
Returns the value of attribute job.
Instance Method Summary collapse
-
#initialize(job) ⇒ PeriodicTimer
constructor
A new instance of PeriodicTimer.
- #shutdown ⇒ Object
Constructor Details
#initialize(job) ⇒ PeriodicTimer
Returns a new instance of PeriodicTimer.
225 226 227 |
# File 'lib/cable_room/channel_base.rb', line 225 def initialize(job) @job = job end |
Instance Attribute Details
#job ⇒ Object (readonly)
Returns the value of attribute job.
221 222 223 |
# File 'lib/cable_room/channel_base.rb', line 221 def job @job end |
Instance Method Details
#shutdown ⇒ Object
229 230 231 |
# File 'lib/cable_room/channel_base.rb', line 229 def shutdown job.unschedule end |