Module: HotCell::Supervisor::Timed

Included in:
Child, Sweep
Defined in:
lib/hot_cell/supervisor.rb

Overview

The one deadline the supervisor enforces, on a worker and on the sweeper alike: from started_at, for deadline seconds, killed once. killed_for is the one-kill latch — a killed process stays here until the reap, and without the latch it would be re-killed and re-logged on every pass until then. See Child#overdue? for the measurement behind that.

Instance Method Summary collapse

Instance Method Details

#expires_atObject



34
35
36
# File 'lib/hot_cell/supervisor.rb', line 34

def expires_at
  started_at + deadline if timed?
end

#overdue?(now) ⇒ Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/hot_cell/supervisor.rb', line 30

def overdue?(now)
  timed? && now - started_at >= deadline
end