Sha256: 26e94afceace69280b03c2670d94e5faa4ce77495504adfa5f1dc4fb579af004

Contents?: true

Size: 535 Bytes

Versions: 24

Compression:

Stored size: 535 Bytes

Contents

module AMQP
  class ConsumerTagGenerator

    #
    # API
    #

    # @return [String] Generated consumer tag
    def generate
      "#{Kernel.rand}-#{Time.now.to_i * 1000}-#{Kernel.rand(999_999_999_999)}"
    end # generate

    # @return [String] Generated consumer tag
    def generate_for(queue)
      raise ArgumentError, "argument must respond to :name" unless queue.respond_to?(:name)

      "#{queue.name}-#{Time.now.to_i * 1000}-#{Kernel.rand(999_999_999_999)}"
    end # generate_for(queue)
  end # ConsumerTagGenerator
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
amqp-1.8.0 lib/amqp/consumer_tag_generator.rb
amqp-1.7.0 lib/amqp/consumer_tag_generator.rb
amqp-1.6.0 lib/amqp/consumer_tag_generator.rb
amqp-1.5.3 lib/amqp/consumer_tag_generator.rb
amqp-1.5.2 lib/amqp/consumer_tag_generator.rb
amqp-1.5.1 lib/amqp/consumer_tag_generator.rb
amqp-1.5.0 lib/amqp/consumer_tag_generator.rb
amqp-1.4.2 lib/amqp/consumer_tag_generator.rb
amqp-1.4.1 lib/amqp/consumer_tag_generator.rb
amqp-1.4.0 lib/amqp/consumer_tag_generator.rb
amqp-1.3.0 lib/amqp/consumer_tag_generator.rb
amqp-1.2.1 lib/amqp/consumer_tag_generator.rb
amqp-1.2.0 lib/amqp/consumer_tag_generator.rb
amqp-1.1.8 lib/amqp/consumer_tag_generator.rb
amqp-1.1.7 lib/amqp/consumer_tag_generator.rb
amqp-1.1.6 lib/amqp/consumer_tag_generator.rb
amqp-1.1.5 lib/amqp/consumer_tag_generator.rb
amqp-1.1.4 lib/amqp/consumer_tag_generator.rb
amqp-1.1.3 lib/amqp/consumer_tag_generator.rb
amqp-1.1.2 lib/amqp/consumer_tag_generator.rb