Sha256: 647e3aec67940c93508e8e6c354d7f91872dd6233c64efb29d058b5a9ce908a0
Contents?: true
Size: 1.38 KB
Versions: 9
Compression:
Stored size: 1.38 KB
Contents
# Generated sqs 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 NOTES # # The aws-sdk gem provides various mechanisms for configuring the # client libraries. It is recommended that you look at the # documentation for the most up-to-date or appropriate way of # configuring it. # # At the time of writing, the (aws-sdk) gem will attempt to use # environment variables or the EC2 metadata service to auto-configure # itself. If this is not the case, you can pass configuration options # into DaemonKit::SQS.run which will be passed on to the underlying # AWS::SQS client. By default, we use the 'config/sqs.yml' file to do # this configuration. # Run an event-loop for processing DaemonKit::SQS.run do |sqs| # Inside this block you have access to an AWS::SQS queue = sqs.queues[sqs.queues.url_for('test')] queue.poll do |msg| # msg may be nil if long-polling is disabled or the poll expires - # in either case, this is an indication that the queue is (almost) # empty DaemonKit.logger.debug "Received message: #{msg.inspect}" end end
Version data entries
9 entries across 9 versions & 1 rubygems