/usr/lib/ruby/vendor_ruby/bunny/consumer.rb is in ruby-bunny 0.7.8-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | # 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
|