Sha256: 27cbe230bca4b59b990c8393c0ec0206a90a48c48e7d6464f9b3fcc30a6c66cf

Contents?: true

Size: 837 Bytes

Versions: 1

Compression:

Stored size: 837 Bytes

Contents

# encoding: utf-8

$:.unshift File.expand_path("../../../lib", __FILE__)
require "mq"

AMQP.start(:host => "localhost") do
  @counter = 0
  amq = MQ.new

  3.times do
    amq.queue("") do |queue|
      puts "Queue #{queue.name} declared."
      puts "All queues: #{amq.queues.map(&:name).inspect}", ""

      @counter += 1
    end
  end

  EM.add_periodic_timer(0.1) do
    EM.stop if @counter == 3
  end
end

__END__
Queue amq.gen-qeaCcyVCG50S6QC4U/zNoA== declared.
All queues: [nil, nil, "amq.gen-qeaCcyVCG50S6QC4U/zNoA=="]

Queue amq.gen-AinMI7PBa2n1fFRIaGEAog== declared.
All queues: [nil, "amq.gen-AinMI7PBa2n1fFRIaGEAog==", "amq.gen-qeaCcyVCG50S6QC4U/zNoA=="]

Queue amq.gen-ROdJW1LZJVJulUIh8KZqkw== declared.
All queues: ["amq.gen-ROdJW1LZJVJulUIh8KZqkw==", "amq.gen-AinMI7PBa2n1fFRIaGEAog==", "amq.gen-qeaCcyVCG50S6QC4U/zNoA=="]

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
amqp-0.7.0.pre examples/mq/callbacks.rb