Module: EQ::Scheduling

Defined in:
lib/eq-scheduling.rb,
lib/eq-scheduling/scheduler.rb

Defined Under Namespace

Classes: Scheduler

Constant Summary collapse

EQ_SCHEDULER =
:_eq_scheduler

Class Method Summary collapse

Class Method Details

.bootObject



15
16
17
# File 'lib/eq-scheduling.rb', line 15

def boot
  EQ::Scheduling::Scheduler.supervise_as EQ_SCHEDULER, EQ.config
end

.eventsObject



27
28
29
30
31
32
# File 'lib/eq-scheduling.rb', line 27

def events
  Clockwork.class_variable_get('@@events').map do |event|
    [ event.job,
      event.instance_variable_get('@period') ]  
  end
end

.schedulerObject



23
24
25
# File 'lib/eq-scheduling.rb', line 23

def scheduler
  Celluloid::Actor[EQ_SCHEDULER]
end

.shutdownObject



19
20
21
# File 'lib/eq-scheduling.rb', line 19

def shutdown
  scheduler.terminate! if scheduler
end