Sha256: 7bed37e3653505fb811059e7e67d1f6d1378fe81450620812a5d03d28d95e01d

Contents?: true

Size: 1.13 KB

Versions: 16

Compression:

Stored size: 1.13 KB

Contents

# encoding: utf-8

####################################
# NOTE: THIS CLASS IS HERE TO MAKE #
# TRANSITION TO AMQ CLIENT EASIER  #
####################################

require "qrack/subscription"

# NOTE: This file is rather a temporary hack to fix
# https://github.com/ruby-amqp/bunny/issues/9 then
# some permanent solution. It's mostly copied from
# the AMQP and AMQ Client gems. Later on we should
# use AMQ Client directly and just inherit from
# the AMQ::Client::Sync::Consumer class.

module Bunny

  # AMQP consumers are entities that handle messages delivered
  # to them ("push API" as opposed to "pull API") by AMQP broker.
  # Every consumer is associated with a queue. Consumers can be
  # exclusive (no other consumers can be registered for the same
  # queue) or not (consumers share the queue). In the case of
  # multiple consumers per queue, messages are distributed in
  # round robin manner with respect to channel-level prefetch
  # setting).
  class Consumer < Qrack::Subscription
    def initialize(*args)
      super(*args)
      @consumer_tag ||= (1..32).to_a.shuffle.join
    end

    alias_method :consume, :start
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
bunny-0.7.13 lib/bunny/consumer.rb
bunny-0.7.12 lib/bunny/consumer.rb
bunny-0.7.11 lib/bunny/consumer.rb
bunny-0.7.10 lib/bunny/consumer.rb
bunny-0.8.0 lib/bunny/consumer.rb
sparqcode_bunny-0.0.2 lib/bunny/consumer.rb
bunny-0.7.9 lib/bunny/consumer.rb
sparqcode_bunny-0.0.1 lib/bunny/consumer.rb
bunny-0.7.8 lib/bunny/consumer.rb
bunny-0.7.6 lib/bunny/consumer.rb
bunny-0.7.5 lib/bunny/consumer.rb
bunny-0.7.4 lib/bunny/consumer.rb
bunny-0.7.3 lib/bunny/consumer.rb
bunny-0.7.2 lib/bunny/consumer.rb
bunny-0.7.1 lib/bunny/consumer.rb
bunny-0.7 lib/bunny/consumer.rb