Pull support into a daemon for being a nanite agent.
# File lib/daemon_kit/nanite/agent.rb, line 31 def instance @instance ||= new end
# File lib/daemon_kit/nanite/agent.rb, line 49 def run(&block) # Ensure graceful shutdown of the connection to the broker DaemonKit.trap('INT') { ::EM.stop } DaemonKit.trap('TERM') { ::EM.stop } ::Nanite::Log.logger = DaemonKit.logger # Start our mapper mapper_thread = Thread.new do EM.run do agent = ::Nanite::Agent.new( @config ) agent.init_block = block agent.run end end mapper_thread.join end
Generated with the Darkfish Rdoc Generator 2.