Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

19 lines (13 sloc) 0.402 kb
require 'rubygems'
require 'mq'
Signal.trap('INT') { AMQP.stop{ EM.stop } }
Signal.trap('TERM'){ AMQP.stop{ EM.stop } }
AMQP.start do
count = 0
queue = MQ.queue('jobs')
puts "pid #{Process.pid} start sending messages"
#sends messages periodically
EM.add_periodic_timer(0.1) do
queue.publish("#{count += 1} sent from #{Process.pid} at #{Time.now.strftime('%H:%M:%S')}")
end
end
Jump to Line
Something went wrong with that request. Please try again.