Class: Puma::Cluster::Worker
- Inherits:
-
Object
- Object
- Puma::Cluster::Worker
- Defined in:
- lib/puma/cluster.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.
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
#phase ⇒ Object (readonly)
Returns the value of attribute phase.
38 39 40 |
# File 'lib/puma/cluster.rb', line 38 def phase @phase end |
#pid ⇒ Object (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
40 41 42 |
# File 'lib/puma/cluster.rb', line 40 def booted? @stage == :booted end |
#term ⇒ Object
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 |