Class: Rekiq::Scheduler
- Inherits:
-
Object
- Object
- Rekiq::Scheduler
- Defined in:
- lib/rekiq/scheduler.rb
Instance Method Summary collapse
-
#initialize(worker_name, queue, args, contract) ⇒ Scheduler
constructor
A new instance of Scheduler.
- #schedule_initial_work(from = Time.now) ⇒ Object
- #schedule_next_work(previous_work_time) ⇒ Object
Constructor Details
#initialize(worker_name, queue, args, contract) ⇒ Scheduler
Returns a new instance of Scheduler.
3 4 5 6 7 8 |
# File 'lib/rekiq/scheduler.rb', line 3 def initialize(worker_name, queue, args, contract) @worker_name = worker_name @queue = queue @args = args @contract = contract end |
Instance Method Details
#schedule_initial_work(from = Time.now) ⇒ Object
10 11 12 13 |
# File 'lib/rekiq/scheduler.rb', line 10 def schedule_initial_work(from = Time.now) @work_time = @contract.initial_work_time(from) schedule_work end |
#schedule_next_work(previous_work_time) ⇒ Object
15 16 17 18 |
# File 'lib/rekiq/scheduler.rb', line 15 def schedule_next_work(previous_work_time) @work_time = @contract.next_work_time(previous_work_time) schedule_work end |