Class: Puma::Cluster::Worker

Inherits:
Object
  • Object
show all
Defined in:
lib/puma/cluster.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pid, phase) ⇒ Worker

Returns a new instance of Worker.



32
33
34
35
36
# File 'lib/puma/cluster.rb', line 32

def initialize(pid, phase)
  @pid = pid
  @phase = phase
  @stage = :started
end

Instance Attribute Details

#phaseObject (readonly)

Returns the value of attribute phase.



38
39
40
# File 'lib/puma/cluster.rb', line 38

def phase
  @phase
end

#pidObject (readonly)

Returns the value of attribute pid.



38
39
40
# File 'lib/puma/cluster.rb', line 38

def pid
  @pid
end

Instance Method Details

#boot!Object



44
45
46
# File 'lib/puma/cluster.rb', line 44

def boot!
  @stage = :booted
end

#booted?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/puma/cluster.rb', line 40

def booted?
  @stage == :booted
end

#termObject



48
49
50
51
52
53
# File 'lib/puma/cluster.rb', line 48

def term
  begin
    Process.kill "TERM", @pid
  rescue Errno::ESRCH
  end
end