Sha256: 0d13869d8b6d7e9975fa1daf26db4b7aa3b312c14161a6ba3e3743e47468acfe

Contents?: true

Size: 618 Bytes

Versions: 32

Compression:

Stored size: 618 Bytes

Contents

# encoding: utf-8

module AMQ
  module Client
    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 # Client
end # AMQ

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
amq-client-1.0.4 lib/amq/client/consumer_tag_generator.rb
amq-client-1.0.3 lib/amq/client/consumer_tag_generator.rb
amq-client-1.1.0.pre1 lib/amq/client/consumer_tag_generator.rb
amq-client-1.0.2 lib/amq/client/consumer_tag_generator.rb
amq-client-1.0.1 lib/amq/client/consumer_tag_generator.rb
amq-client-1.0.0 lib/amq/client/consumer_tag_generator.rb
amq-client-0.9.12 lib/amq/client/consumer_tag_generator.rb
amq-client-0.9.11 lib/amq/client/consumer_tag_generator.rb
amq-client-0.9.10 lib/amq/client/consumer_tag_generator.rb
amq-client-0.9.9 lib/amq/client/consumer_tag_generator.rb
amq-client-0.9.8 lib/amq/client/consumer_tag_generator.rb
amq-client-0.9.7 lib/amq/client/consumer_tag_generator.rb
amq-client-0.9.6 lib/amq/client/consumer_tag_generator.rb
amq-client-0.9.5 lib/amq/client/consumer_tag_generator.rb
amq-client-0.9.4 lib/amq/client/consumer_tag_generator.rb
amq-client-1.0.0.pre2 lib/amq/client/consumer_tag_generator.rb
amq-client-0.9.3 lib/amq/client/consumer_tag_generator.rb
amq-client-1.0.0.pre1 lib/amq/client/consumer_tag_generator.rb
amq-client-0.9.2 lib/amq/client/consumer_tag_generator.rb
amq-client-0.9.1 lib/amq/client/consumer_tag_generator.rb