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.22.0 lib/bunny/consumer_tag_generator.rb
bunny-2.21.0 lib/bunny/consumer_tag_generator.rb
bunny-2.20.3 lib/bunny/consumer_tag_generator.rb
bunny-2.20.2 lib/bunny/consumer_tag_generator.rb
bunny-2.20.1 lib/bunny/consumer_tag_generator.rb
bunny-2.20.0 lib/bunny/consumer_tag_generator.rb
garaio_bunny-2.19.2 lib/bunny/consumer_tag_generator.rb
garaio_bunny-2.19.1 lib/bunny/consumer_tag_generator.rb
bunny-2.19.0 lib/bunny/consumer_tag_generator.rb
bunny-2.18.0 lib/bunny/consumer_tag_generator.rb
bunny-2.17.0 lib/bunny/consumer_tag_generator.rb
bunny-2.16.1 lib/bunny/consumer_tag_generator.rb
bunny-2.15.0 lib/bunny/consumer_tag_generator.rb
bunny-2.14.4 lib/bunny/consumer_tag_generator.rb
bunny-2.14.3 lib/bunny/consumer_tag_generator.rb
bunny-2.14.2 lib/bunny/consumer_tag_generator.rb
bunny-2.14.1 lib/bunny/consumer_tag_generator.rb
bunny-2.13.0 lib/bunny/consumer_tag_generator.rb
bunny-2.12.1 lib/bunny/consumer_tag_generator.rb
bunny-2.12.0 lib/bunny/consumer_tag_generator.rb