Module: Sidetiq::Schedulable::ClassMethods
- Defined in:
- lib/sidetiq/schedulable.rb
Instance Method Summary collapse
-
#last_scheduled_occurrence ⇒ Object
Public: Returns a Float timestamp of the last scheduled run.
-
#next_scheduled_occurrence ⇒ Object
Public: Returns a Float timestamp of the next scheduled run.
-
#recurrence(options = {}, &block) ⇒ Object
:nodoc:.
-
#tiq(*args, &block) ⇒ Object
:nodoc:.
Instance Method Details
#last_scheduled_occurrence ⇒ Object
Public: Returns a Float timestamp of the last scheduled run.
16 17 18 |
# File 'lib/sidetiq/schedulable.rb', line 16 def last_scheduled_occurrence "last" end |
#next_scheduled_occurrence ⇒ Object
Public: Returns a Float timestamp of the next scheduled run.
21 22 23 |
# File 'lib/sidetiq/schedulable.rb', line 21 def next_scheduled_occurrence "next" end |
#recurrence(options = {}, &block) ⇒ Object
:nodoc:
32 33 34 35 36 37 38 39 |
# File 'lib/sidetiq/schedulable.rb', line 32 def recurrence( = {}, &block) # :nodoc: clock = Sidetiq::Clock.instance clock.synchronize do schedule = clock.schedule_for(self) schedule.instance_eval(&block) schedule.() end end |
#tiq(*args, &block) ⇒ Object
:nodoc:
25 26 27 28 29 30 |
# File 'lib/sidetiq/schedulable.rb', line 25 def tiq(*args, &block) # :nodoc: Sidetiq.logger.warn "DEPRECATION WARNING: Sidetiq::Schedulable#tiq" << " is deprecated and will be removed. Use" << " Sidetiq::Schedulable#recurrence instead." recurrence(*args, &block) end |