Parent

Puma::Cluster::Worker

Attributes

index[R]
last_checkin[R]
phase[R]
pid[R]
signal[R]

Public Class Methods

new(idx, pid, phase) click to toggle source
# File lib/puma/cluster.rb, line 33
def initialize(idx, pid, phase)
  @index = idx
  @pid = pid
  @phase = phase
  @stage = :started
  @signal = "TERM"
  @last_checkin = Time.now
end

Public Instance Methods

boot!() click to toggle source
# File lib/puma/cluster.rb, line 48
def boot!
  @last_checkin = Time.now
  @stage = :booted
end
booted?() click to toggle source
# File lib/puma/cluster.rb, line 44
def booted?
  @stage == :booted
end
kill() click to toggle source
# File lib/puma/cluster.rb, line 74
def kill
  Process.kill "KILL", @pid
rescue Errno::ESRCH
end
ping!() click to toggle source
# File lib/puma/cluster.rb, line 53
def ping!
  @last_checkin = Time.now
end
ping_timeout?(which) click to toggle source
# File lib/puma/cluster.rb, line 57
def ping_timeout?(which)
  Time.now - @last_checkin > which
end
term() click to toggle source
# File lib/puma/cluster.rb, line 61
def term
  begin
    if @first_term_sent && (Time.new - @first_term_sent) > 30
      @signal = "KILL"
    else
      @first_term_sent ||= Time.new
    end

    Process.kill @signal, @pid
  rescue Errno::ESRCH
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.