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-0.10.7 lib/bunny/consumer_tag_generator.rb
bunny-0.10.6 lib/bunny/consumer_tag_generator.rb
bunny-1.0.0.pre6 lib/bunny/consumer_tag_generator.rb
bunny-0.10.5 lib/bunny/consumer_tag_generator.rb
bunny-1.0.0.pre5 lib/bunny/consumer_tag_generator.rb
bunny-0.10.4 lib/bunny/consumer_tag_generator.rb
bunny-0.10.3 lib/bunny/consumer_tag_generator.rb
bunny-1.0.0.pre4 lib/bunny/consumer_tag_generator.rb
bunny-0.10.2 lib/bunny/consumer_tag_generator.rb
bunny-0.10.1 lib/bunny/consumer_tag_generator.rb
bunny-0.10.0 lib/bunny/consumer_tag_generator.rb
bunny-1.0.0.pre3 lib/bunny/consumer_tag_generator.rb
bunny-0.9.8 lib/bunny/consumer_tag_generator.rb
bunny-1.0.0.pre2 lib/bunny/consumer_tag_generator.rb
bunny-0.9.7 lib/bunny/consumer_tag_generator.rb
bunny-0.9.6 lib/bunny/consumer_tag_generator.rb
bunny-0.9.5 lib/bunny/consumer_tag_generator.rb
bunny-0.9.4 lib/bunny/consumer_tag_generator.rb
bunny-1.0.0.pre1 lib/bunny/consumer_tag_generator.rb
bunny-0.9.3 lib/bunny/consumer_tag_generator.rb