Class: Pitchfork::Service
Constant Summary
Constants inherited from Worker
Instance Attribute Summary
Attributes inherited from Worker
#generation, #master, #nr, #pid, #requests_count
Instance Method Summary collapse
-
#initialize(pid: nil, generation: 0) ⇒ Service
constructor
A new instance of Service.
- #register_to_master(control_socket) ⇒ Object
- #service? ⇒ Boolean
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?, #outdated?, #pending?, #promote, #promote!, #promoted!, #reset, #soft_kill, #spawn_service, #spawn_worker, #start_promotion, #to_io, #update, #update_deadline
Constructor Details
#initialize(pid: nil, generation: 0) ⇒ Service
Returns a new instance of Service.
245 246 247 |
# File 'lib/pitchfork/worker.rb', line 245 def initialize(pid: nil, generation: 0) super(nil, pid: pid, generation: generation) end |
Instance Method Details
#register_to_master(control_socket) ⇒ Object
253 254 255 256 257 258 |
# File 'lib/pitchfork/worker.rb', line 253 def register_to_master(control_socket) create_socketpair! = Message::ServiceSpawned.new(@pid, generation, @master) control_socket.sendmsg() @master.close end |
#service? ⇒ Boolean
249 250 251 |
# File 'lib/pitchfork/worker.rb', line 249 def service? true end |