Class: Pitchfork::Service
Constant Summary
Constants inherited from Worker
Instance Attribute Summary
Attributes inherited from Worker
#generation, #monitor, #nr, #pid, #requests_count
Instance Method Summary collapse
-
#initialize(pid: nil, generation: 0) ⇒ Service
constructor
A new instance of Service.
- #register_to_monitor(control_socket) ⇒ Object
- #service? ⇒ Boolean
- #to_log ⇒ Object
Methods inherited from Worker
#==, #accept_nonblock, #after_fork_in_child, #close, #create_socketpair!, #deadline, #deadline=, #exiting?, #fake_sig, #finish_promotion, #hard_kill, #increment_requests_count, #mold?, #notify_ready, #outdated?, #pending?, #promote, #promote!, #promoted!, #ready=, #ready?, #reset, #soft_kill, #spawn_service, #spawn_worker, #start_promotion, #to_io, #update, #update_deadline, #worker?
Constructor Details
#initialize(pid: nil, generation: 0) ⇒ Service
Returns a new instance of Service.
281 282 283 |
# File 'lib/pitchfork/worker.rb', line 281 def initialize(pid: nil, generation: 0) super(nil, pid: pid, generation: generation) end |
Instance Method Details
#register_to_monitor(control_socket) ⇒ Object
289 290 291 292 293 294 |
# File 'lib/pitchfork/worker.rb', line 289 def register_to_monitor(control_socket) create_socketpair! = Message::ServiceSpawned.new(@pid, generation, @monitor) control_socket.sendmsg() @monitor.close end |
#service? ⇒ Boolean
285 286 287 |
# File 'lib/pitchfork/worker.rb', line 285 def service? true end |
#to_log ⇒ Object
296 297 298 |
# File 'lib/pitchfork/worker.rb', line 296 def to_log pid ? "service gen=#{generation} pid=#{pid}" : "service gen=#{generation}" end |