class ElasticAPM::Transport::Worker

def work_forever

def work_forever
  while (msg = queue.pop)
    case msg
    when StopMessage
      debug 'Stopping worker [%s]', self
      connection.flush(:halt)
      break
    else
      process msg
    end
  end
rescue Exception => e
  warn 'Worker died with exception: %s', e.inspect
  debug e.backtrace.join("\n")
end