Sha256: d5c929ef47a67110b7886fdf17469fcd2b61b257c1e5fd02186cba0acd1704ab

Contents?: true

Size: 1.1 KB

Versions: 30

Compression:

Stored size: 1.1 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
  # 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
  # AMQP.conn.connection_status do |status|
  #   DaemonKit.logger.debug("AMQP connection status changed: #{status}")
  #   if status == :disconnected
  #     AMQP.conn.reconnect(true)
  #   end
  # end

  amq = ::MQ.new
  amq.queue('test').subscribe do |msg|
    DaemonKit.logger.debug "Received message: #{msg.inspect}"
  end
end

Version data entries

30 entries across 30 versions & 7 rubygems

Version Path
kennethkalmer-daemon-kit-0.1.7.10 daemon_generators/amqp/templates/libexec/daemon.rb
kennethkalmer-daemon-kit-0.1.7.9 daemon_generators/amqp/templates/libexec/daemon.rb
queso-daemon-kit-0.1.7.10 daemon_generators/amqp/templates/libexec/daemon.rb
skaar-daemon-kit-0.1.7.10 daemon_generators/amqp/templates/libexec/daemon.rb
amqp-daemon-kit-1.0.1 lib/generators/daemon_kit/amqp/templates/libexec/%app_name%-daemon.rb
amqp-daemon-kit-0.1.8.2 lib/generators/daemon_kit/amqp/templates/libexec/%app_name%-daemon.rb
amqp-daemon-kit-0.1.8.1 lib/generators/daemon_kit/amqp/templates/libexec/%app_name%-daemon.rb
daemon-kit-0.1.8.1 lib/generators/daemon_kit/amqp/templates/libexec/%app_name%-daemon.rb
daemon-kit-0.1.8 lib/generators/daemon_kit/amqp/templates/libexec/%app_name%-daemon.rb
daemon-kit-0.1.8rc3 lib/generators/daemon_kit/amqp/templates/libexec/%app_name%-daemon.rb
textgoeshere-daemon-kit-0.1.8.31 lib/generators/daemon_kit/amqp/templates/libexec/%app_name%-daemon.rb
textgoeshere-daemon-kit-0.1.8rc3 lib/generators/daemon_kit/amqp/templates/libexec/%app_name%-daemon.rb
daemon-kit-0.1.8rc2 lib/generators/daemon_kit/amqp/templates/libexec/%app_name%-daemon.rb
daemon-kit-0.1.8rc1 lib/generators/daemon_kit/amqp/templates/libexec/%app_name%-daemon.rb
apphunkd-0.13.0 vendor/daemon_kit/daemon_generators/amqp/templates/libexec/daemon.rb
apphunkd-0.12.2 vendor/daemon_kit/daemon_generators/amqp/templates/libexec/daemon.rb
apphunkd-0.12.1 vendor/daemon_kit/daemon_generators/amqp/templates/libexec/daemon.rb
apphunkd-0.12.0 vendor/daemon_kit/daemon_generators/amqp/templates/libexec/daemon.rb
daemon-kit-0.1.8pre lib/generators/daemon_kit/amqp/templates/libexec/%app_name%-daemon.rb
apphunkd-0.11.1 vendor/daemon_kit/daemon_generators/amqp/templates/libexec/daemon.rb