Sha256: 64b35036549a04bfd747dcfda329498f096c9f37a7f2785e4f4cbdf2644008ac

Contents?: true

Size: 458 Bytes

Versions: 5

Compression:

Stored size: 458 Bytes

Contents

require_relative "../lib/message_queue"

MessageQueue.with_connection(:adapter => :bunny, :serializer => :message_pack) do |conn|
  consumer = conn.new_consumer(
    :queue => {
      :name => "print_time_now"
    },
    :exchange => {
      :name => "time",
      :routing_key => "time.#"
    },
    :subscribe => {
      :block => true
    }
  )

  consumer.subscribe do |delivery_info, metadata, payload|
    puts "Received message: #{payload}"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
message_queue-0.1.1 examples/consumer.rb
message_queue-0.1.0 examples/consumer.rb
message_queue-0.0.4 examples/consumer.rb
message_queue-0.0.3 examples/consumer.rb
message_queue-0.0.2 examples/consumer.rb