Sha256: ee0bf320b8fb1479c96d4f9f5c9eeff2b6d1d40db1a2c5a59347506c8d3412ed

Contents?: true

Size: 532 Bytes

Versions: 125

Compression:

Stored size: 532 Bytes

Contents

module Bunny
  # Used to generate consumer tags in the 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


    # Unique string supposed to be used as a consumer tag.
    #
    # @return [String]  Unique string.
    # @api public
    def generate_prefixed(name = "bunny")
      "#{name}-#{Time.now.to_i * 1000}-#{Kernel.rand(999_999_999_999)}"
    end
  end
end

Version data entries

125 entries across 125 versions & 2 rubygems

Version Path
bunny-2.12.0.rc1 lib/bunny/consumer_tag_generator.rb
bunny-2.11.0 lib/bunny/consumer_tag_generator.rb
bunny-2.11.0.pre1 lib/bunny/consumer_tag_generator.rb
bunny-2.10.0 lib/bunny/consumer_tag_generator.rb
bunny-2.9.2 lib/bunny/consumer_tag_generator.rb
bunny-2.9.1 lib/bunny/consumer_tag_generator.rb
bunny-2.6.7 lib/bunny/consumer_tag_generator.rb
bunny-2.7.4 lib/bunny/consumer_tag_generator.rb
bunny-2.8.1 lib/bunny/consumer_tag_generator.rb
bunny-2.9.0 lib/bunny/consumer_tag_generator.rb
bunny-2.7.3 lib/bunny/consumer_tag_generator.rb
bunny-2.8.0 lib/bunny/consumer_tag_generator.rb
bunny-2.7.2 lib/bunny/consumer_tag_generator.rb
bunny-2.7.1 lib/bunny/consumer_tag_generator.rb
bunny-2.7.0 lib/bunny/consumer_tag_generator.rb
bunny-2.6.6 lib/bunny/consumer_tag_generator.rb
bunny-2.6.5 lib/bunny/consumer_tag_generator.rb
bunny-2.6.4 lib/bunny/consumer_tag_generator.rb
bunny-2.6.3 lib/bunny/consumer_tag_generator.rb
bunny-2.6.2 lib/bunny/consumer_tag_generator.rb