Class: EQ::Scheduling::Scheduler

Inherits:
Object
  • Object
show all
Includes:
Celluloid, Logging
Defined in:
lib/eq-scheduling/scheduler.rb

Instance Method Summary collapse

Methods included from Logging

#debug, #info, #log_error

Constructor Details

#initialize(config) ⇒ Scheduler

Returns a new instance of Scheduler.



6
7
8
# File 'lib/eq-scheduling/scheduler.rb', line 6

def initialize config
  clockwork!
end

Instance Method Details

#clockworkObject



10
11
12
13
14
15
16
17
# File 'lib/eq-scheduling/scheduler.rb', line 10

def clockwork
  debug 'scheduler running'
  loop do
    Clockwork.tick
    sleep(Clockwork.config[:sleep_timeout])
    return unless Actor.current.alive?
  end
end