Class: Scheduler

Inherits:
Object
  • Object
show all
Defined in:
lib/flote/scheduler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(runner) ⇒ Scheduler

Returns a new instance of Scheduler.



5
6
7
# File 'lib/flote/scheduler.rb', line 5

def initialize runner
  @runner = runner
end

Instance Attribute Details

#interrupt_listenerObject

Returns the value of attribute interrupt_listener.



3
4
5
# File 'lib/flote/scheduler.rb', line 3

def interrupt_listener
  @interrupt_listener
end

Instance Method Details

#startObject



9
10
11
12
13
14
15
16
17
# File 'lib/flote/scheduler.rb', line 9

def start
 @continue = true
register_interrupt_listener
  @runner.start
  while @continue do
    sleep 1
    @runner.execute
  end
end