Sha256: 9f9880eb30dcf604c27bf1b8ba66e0193a3caf5074fffab6455adb9022eb746d

Contents?: true

Size: 538 Bytes

Versions: 28

Compression:

Stored size: 538 Bytes

Contents

module GorgonBunny
  # 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

28 entries across 28 versions & 1 rubygems

Version Path
gorgon-0.11.1 lib/gorgon_bunny/lib/gorgon_bunny/consumer_tag_generator.rb
gorgon-0.11.0 lib/gorgon_bunny/lib/gorgon_bunny/consumer_tag_generator.rb
gorgon-0.10.5 lib/gorgon_bunny/lib/gorgon_bunny/consumer_tag_generator.rb
gorgon-0.10.4 lib/gorgon_bunny/lib/gorgon_bunny/consumer_tag_generator.rb
gorgon-0.10.3 lib/gorgon_bunny/lib/gorgon_bunny/consumer_tag_generator.rb
gorgon-0.10.2 lib/gorgon_bunny/lib/gorgon_bunny/consumer_tag_generator.rb
gorgon-0.10.1 lib/gorgon_bunny/lib/gorgon_bunny/consumer_tag_generator.rb
gorgon-0.10.0 lib/gorgon_bunny/lib/gorgon_bunny/consumer_tag_generator.rb
gorgon-0.9.0 lib/gorgon_bunny/lib/gorgon_bunny/consumer_tag_generator.rb
gorgon-0.8.4 lib/gorgon_bunny/lib/gorgon_bunny/consumer_tag_generator.rb
gorgon-0.8.3 lib/gorgon_bunny/lib/gorgon_bunny/consumer_tag_generator.rb
gorgon-0.8.2 lib/gorgon_bunny/lib/gorgon_bunny/consumer_tag_generator.rb
gorgon-0.8.1 lib/gorgon_bunny/lib/gorgon_bunny/consumer_tag_generator.rb
gorgon-0.8.0 lib/gorgon_bunny/lib/gorgon_bunny/consumer_tag_generator.rb
gorgon-0.7.1 lib/gorgon_bunny/lib/gorgon_bunny/consumer_tag_generator.rb
gorgon-0.7.0 lib/gorgon_bunny/lib/gorgon_bunny/consumer_tag_generator.rb
gorgon-0.7.0.rc4 lib/gorgon_bunny/lib/gorgon_bunny/consumer_tag_generator.rb
gorgon-0.7.0.rc3 lib/gorgon_bunny/lib/gorgon_bunny/consumer_tag_generator.rb
gorgon-0.7.0.rc2 lib/gorgon_bunny/lib/gorgon_bunny/consumer_tag_generator.rb
gorgon-0.7.0.rc1 lib/gorgon_bunny/lib/gorgon_bunny/consumer_tag_generator.rb