Sha256: 81f4ebe3cc31a6538d4e2effcc5eb4ecc69fd0cc3f381a11fa343dc05b812f7b

Contents?: true

Size: 364 Bytes

Versions: 6

Compression:

Stored size: 364 Bytes

Contents

module Jackhammer
  class QueueName
    def self.app_name
      Jackhammer.configuration.app_name
    end

    def self.from_routing_key(routing_key)
      fail(InvalidConfigError, "app_name must be set to determine queue_name from routing_key") if app_name.to_s.empty?

      "#{app_name}_#{routing_key}_q".gsub(/[^\w]+/, '_').gsub(/[_]+/, '_')
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
jackhammer-1.3.4 lib/jackhammer/queue_name.rb
jackhammer-1.3.3 lib/jackhammer/queue_name.rb
jackhammer-1.3.2 lib/jackhammer/queue_name.rb
jackhammer-1.3.1 lib/jackhammer/queue_name.rb
jackhammer-1.3.0 lib/jackhammer/queue_name.rb
jackhammer-1.2.0 lib/jackhammer/queue_name.rb