Module: Fluent::WorkerModule

Defined in:
lib/fluent/supervisor.rb

Instance Method Summary collapse

Instance Method Details

#after_startObject



560
561
562
# File 'lib/fluent/supervisor.rb', line 560

def after_start
  (config[:worker_pid] ||= {})[@worker_id] = @pm.pid
end

#dumpObject



564
565
566
# File 'lib/fluent/supervisor.rb', line 564

def dump
  super unless @stop
end

#spawn(process_manager) ⇒ Object



551
552
553
554
555
556
557
558
# File 'lib/fluent/supervisor.rb', line 551

def spawn(process_manager)
  main_cmd = config[:main_cmd]
  env = {
    'SERVERENGINE_WORKER_ID' => @worker_id.to_i.to_s,
    'FLUENT_INSTANCE_ID' => Fluent::INSTANCE_ID,
  }
  @pm = process_manager.spawn(env, *main_cmd)
end