Class: Puma::CLI::Worker

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pid, phase) ⇒ Worker

Returns a new instance of Worker.



587
588
589
590
591
# File 'lib/puma/cli.rb', line 587

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

Instance Attribute Details

#phaseObject (readonly)

Returns the value of attribute phase.



593
594
595
# File 'lib/puma/cli.rb', line 593

def phase
  @phase
end

#pidObject (readonly)

Returns the value of attribute pid.



593
594
595
# File 'lib/puma/cli.rb', line 593

def pid
  @pid
end

Instance Method Details

#boot!Object



599
600
601
# File 'lib/puma/cli.rb', line 599

def boot!
  @stage = :booted
end

#booted?Boolean

Returns:

  • (Boolean)


595
596
597
# File 'lib/puma/cli.rb', line 595

def booted?
  @stage == :booted
end

#termObject



603
604
605
606
607
608
# File 'lib/puma/cli.rb', line 603

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