Method: OneApm::Collector::ForkedProcessService#initialize

Defined in:
lib/one_apm/collector/support/forked_process_service.rb

#initialize(channel_id) ⇒ ForkedProcessService

Returns a new instance of ForkedProcessService.



9
10
11
12
13
14
15
16
17
18
# File 'lib/one_apm/collector/support/forked_process_service.rb', line 9

def initialize(channel_id)
  @channel_id = channel_id
  @collector = OneApm::Support::Server.new(:name => 'parent', :port => 0)
  @pipe = OneApm::Support::ForkedProcessChannel.channels[@channel_id]
  if @pipe && @pipe.parent_pid != $$
    @pipe.after_fork_in_child
  else
    OneApm::Manager.logger.error("No communication channel to parent process.")
  end
end