Sha256: 14928d00ef47a42181f77ce02f178811e04e685332bffdabb38ec0dfb0ec1cf8
Contents?: true
Size: 873 Bytes
Versions: 20
Compression:
Stored size: 873 Bytes
Contents
# Generated amqp daemon # Do your post daemonization configuration here # At minimum you need just the first line (without the block), or a lot # of strange things might start happening... DaemonKit::Application.running! do |config| # Trap signals with blocks or procs # config.trap( 'INT' ) do # # do something clever # end # config.trap( 'TERM', Proc.new { puts 'Going down' } ) end # IMPORTANT CONFIGURATION NOTE # # Please review and update 'config/amqp.yml' accordingly or this # daemon won't work as advertised. # Run an event-loop for processing DaemonKit::AMQP.run do # Inside this block we're running inside the reactor setup by the # amqp gem. Any code in the examples (from the gem) would work just # fine here. amq = ::MQ.new amq.queue('test').subscribe do |msg| DaemonKit.logger.debug "Received message: #{msg.inspect}" end end
Version data entries
20 entries across 20 versions & 2 rubygems