Class: Einhorn::Event::ACKTimer

Inherits:
Timer
  • Object
show all
Includes:
Persistent
Defined in:
lib/einhorn/event/ack_timer.rb

Instance Attribute Summary

Attributes inherited from Timer

#time

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Persistent

included, persistent?

Methods inherited from Timer

#deregister!, #expires_at, open, #register!, #ring!

Constructor Details

#initialize(time, pid, start = nil) ⇒ ACKTimer

Returns a new instance of ACKTimer.



5
6
7
8
9
10
# File 'lib/einhorn/event/ack_timer.rb', line 5

def initialize(time, pid, start=nil)
  super(time, start) do
    Einhorn::Command.register_timer_ack(time, pid)
  end
  @pid = pid
end

Class Method Details

.from_state(state) ⇒ Object



16
17
18
# File 'lib/einhorn/event/ack_timer.rb', line 16

def self.from_state(state)
  self.open(state[:time], state[:pid], state[:start])
end

Instance Method Details

#to_stateObject



12
13
14
# File 'lib/einhorn/event/ack_timer.rb', line 12

def to_state
  {:class => self.class.to_s, :time => @time, :start => @start, :pid => @pid}
end