Class: AMQP::ConsumerTagGenerator
- Inherits:
-
Object
- Object
- AMQP::ConsumerTagGenerator
- Defined in:
- lib/amqp/consumer_tag_generator.rb
Instance Method Summary collapse
-
#generate ⇒ String
Generated consumer tag.
-
#generate_for(queue) ⇒ String
Generated consumer tag.
Instance Method Details
#generate ⇒ String
Returns Generated consumer tag.
9 10 11 |
# File 'lib/amqp/consumer_tag_generator.rb', line 9 def generate "#{Kernel.rand}-#{Time.now.to_i * 1000}-#{Kernel.rand(999_999_999_999)}" end |
#generate_for(queue) ⇒ String
Returns Generated consumer tag.
14 15 16 17 18 |
# File 'lib/amqp/consumer_tag_generator.rb', line 14 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 |