Skip to content

Instantly share code, notes, and snippets.

@workmaster2n
Created January 27, 2014 19:02
Show Gist options
  • Save workmaster2n/8655234 to your computer and use it in GitHub Desktop.
Save workmaster2n/8655234 to your computer and use it in GitHub Desktop.
desc "all in one"
task :all_in_one => :environment do
#q here is a message q. Assume it receives messages at the rate of 10/second
q.subscribe(:block => true) do |delivery_info, properties, body|
#process the message (body)
puts "I got a message: #{body}"
#I'd like every 10 seconds to output Total Messages Received: 13021
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment