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.



663
664
665
666
667
# File 'lib/puma/cli.rb', line 663

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

Instance Attribute Details

#phaseObject (readonly)

Returns the value of attribute phase.



669
670
671
# File 'lib/puma/cli.rb', line 669

def phase
  @phase
end

#pidObject (readonly)

Returns the value of attribute pid.



669
670
671
# File 'lib/puma/cli.rb', line 669

def pid
  @pid
end

Instance Method Details

#boot!Object



675
676
677
# File 'lib/puma/cli.rb', line 675

def boot!
  @stage = :booted
end

#booted?Boolean

Returns:

  • (Boolean)


671
672
673
# File 'lib/puma/cli.rb', line 671

def booted?
  @stage == :booted
end

#termObject



679
680
681
682
683
684
# File 'lib/puma/cli.rb', line 679

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