Class: Puma::CLI::Worker
- Inherits:
-
Object
- Object
- Puma::CLI::Worker
- Defined in:
- lib/puma/cli.rb
Instance Attribute Summary collapse
-
#phase ⇒ Object
readonly
Returns the value of attribute phase.
-
#pid ⇒ Object
readonly
Returns the value of attribute pid.
Instance Method Summary collapse
- #boot! ⇒ Object
- #booted? ⇒ Boolean
-
#initialize(pid, phase) ⇒ Worker
constructor
A new instance of Worker.
- #term ⇒ Object
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
#phase ⇒ Object (readonly)
Returns the value of attribute phase.
669 670 671 |
# File 'lib/puma/cli.rb', line 669 def phase @phase end |
#pid ⇒ Object (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
671 672 673 |
# File 'lib/puma/cli.rb', line 671 def booted? @stage == :booted end |
#term ⇒ Object
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 |