Class: Einhorn::Event::ACKTimer
- Includes:
- Persistent
- Defined in:
- lib/einhorn/event/ack_timer.rb
Instance Attribute Summary
Attributes inherited from Timer
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(time, pid, start = nil) ⇒ ACKTimer
constructor
A new instance of ACKTimer.
- #to_state ⇒ Object
Methods included from 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_state ⇒ Object
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 |