Class: EventedBluepill::ProcessTimer

Inherits:
Coolio::TimerWatcher
  • Object
show all
Defined in:
lib/evented_bluepill/process.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(process) ⇒ ProcessTimer

Returns a new instance of ProcessTimer.



14
15
16
17
# File 'lib/evented_bluepill/process.rb', line 14

def initialize(process)
  self.process = process
  super(1, true)
end

Instance Attribute Details

#processObject

Returns the value of attribute process.



12
13
14
# File 'lib/evented_bluepill/process.rb', line 12

def process
  @process
end

Instance Method Details

#on_timerObject



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/evented_bluepill/process.rb', line 19

def on_timer
  return if self.process.skipping_ticks?
  self.process.skip_ticks_until = nil

  # clear the memoization per tick
  self.process.process_running = nil

  # run state machine transitions
  self.process.tick

  self.process.refresh_children! if self.process.up? and self.process.monitor_children?
end