Sha256: 97122c1a3d125ecab8e3ee1abd9c5a2da3b198855519011ae45d639a2704e663
Contents?: true
Size: 832 Bytes
Versions: 36
Compression:
Stored size: 832 Bytes
Contents
#!/usr/bin/env ruby # encoding: utf-8 require "bundler" Bundler.setup $:.unshift File.expand_path("../../lib", __FILE__) require "amqp" AMQP.start(:host => "localhost") do |connection| # Send Connection.Close on Ctrl+C trap(:INT) do unless connection.closing? connection.close { exit! } end end @counter = 0 amq = AMQP::Channel.new amq.prefetch(64, false) do puts "basic.qos callback has fired" end amq.recover do puts "basic.recover callback has fired" end 10.times do amq.queue("") do |queue| puts "Queue #{queue.name} is now declared." puts "All queues: #{amq.queues.map { |q| q.name }.join(', ')}" @counter += 1 end end EM.add_timer(0.3) do connection.disconnect do puts "AMQP connection is now closed." EM.stop end end end
Version data entries
36 entries across 36 versions & 1 rubygems