module NFAgent class Server def run Log.info("Starting up") chunk_handler = ChunkHandler.new poller = Poller.new EM.run { EM::PeriodicTimer.new(5) do chunk_handler.check_full_or_expired end EM::PeriodicTimer.new(60) do Submitter.resubmit_failed_dumps end EM::PeriodicTimer.new(120) do poller.send_heartbeat end EM.start_server "0.0.0.0", 10000, Event, chunk_handler, poller } end def shutdown EM::stop_event_loop end end end