Sha256: 8070bb04d82c44f153ec42dcf9ea3b0bb905897d512c161a25d3cf06d625bcfd
Contents?: true
Size: 1.09 KB
Versions: 5
Compression:
Stored size: 1.09 KB
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 |connection| # 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. # Uncomment this for connection keep-alive # connection.on_tcp_connection_loss do |client, settings| # DaemonKit.logger.debug("AMQP connection status changed: #{status}") # client.reconnect(false, 1) # end amq = AMQP::Channel.new amq.queue('test').subscribe do |msg| DaemonKit.logger.debug "Received message: #{msg.inspect}" end end
Version data entries
5 entries across 5 versions & 1 rubygems