Class: Actor::Mailbox::Timer

Inherits:
Rev::TimerWatcher
  • Object
show all
Defined in:
lib/revactor/mailbox.rb

Overview

Timeout class, used to implement receive timeouts

Instance Method Summary collapse

Constructor Details

#initialize(seconds, actor) ⇒ Timer

Returns a new instance of Timer.



98
99
100
101
# File 'lib/revactor/mailbox.rb', line 98

def initialize(seconds, actor)
  @actor = actor
  super(seconds)
end

Instance Method Details

#on_timerObject



103
104
105
106
107
# File 'lib/revactor/mailbox.rb', line 103

def on_timer
  detach
  @actor.mailbox.timed_out = true
  @actor.scheduler << @actor
end