def start_agent(agent_name, agent_class = Agent)
      puts "#{human_readable_name} being started"

      if @options[:fiber_pool_size]
        require 'fiber_pool'
        @options[:fiber_pool] = FiberPool.new(@options[:fiber_pool_size])
        EM_S.fiber_pool = @options[:fiber_pool]
      end

      EM.error_handler do |e|
        Log.error("EM block execution failed with exception", e, :trace)
        Log.error("\n\n===== Exiting due to EM block exception =====\n\n")
        # Cannot rely on EM.stop at this point, so exit to give chance for monitor restart
        exit(1)
      end

      EM_S.run do
        begin
          @@agent = agent_class.start(@options)
        rescue SystemExit
          raise # Let parents of forked (daemonized) processes die
        rescue PidFile::AlreadyRunning
          puts "#{human_readable_name} already running"
          EM.stop
        rescue Exception => e
          puts Log.format("#{human_readable_name} failed", e, :trace)
          EM.stop
        end
      end
      true
    end
def start_agent(agent_name, agent_class = Agent)
      puts "#{human_readable_name} being started"

      if @options[:fiber_pool_size]
        require 'fiber_pool'
        @options[:fiber_pool] = FiberPool.new(@options[:fiber_pool_size])
        EM_S.fiber_pool = @options[:fiber_pool]
      end

      EM.error_handler do |e|
        Log.error("EM block execution failed with exception", e, :trace)
        Log.error("\n\n===== Exiting due to EM block exception =====\n\n")
        # Cannot rely on EM.stop at this point, so exit to give chance for monitor restart
        exit(1)
      end

      EM_S.run do
        begin
          @@agent = agent_class.start(@options)
        rescue SystemExit
          raise # Let parents of forked (daemonized) processes die
        rescue PidFile::AlreadyRunning
          puts "#{human_readable_name} already running"
          EM.stop
        rescue Exception => e
          puts Log.format("#{human_readable_name} failed", e, :trace)
          EM.stop
        end
      end
      true
    end
Start agent

 === Parameters
 agent_name(String):: Agent name
 agent_class(Agent):: Agent class

 === Return
 true:: Always return true