Sha256: bde08b23d292150a963611b6ffaf4e4d73e0cec20ff25f7b7c8516e63451fb54

Contents?: true

Size: 901 Bytes

Versions: 51

Compression:

Stored size: 901 Bytes

Contents

# frozen_string_literal: true

module RubyRabbitmqJanus
  module Tools
    # @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv>

    # # Manage Janus instance
    class Cluster
      include Singleton

      # Initialize object for managing each instance to Janus
      def initialize
        @current_instance = nil
      end

      # Specify a name to queue
      def queue_to(instance = nil)
        Tools::Config.instance.options['queues']['standard']['to'] + \
          "-#{instance.blank? ? @current_instance : instance}"
      rescue
        raise Errors::Tools::Cluster::QueueTo
      end

      # Specify a name to admin queue
      def queue_admin_to(instance = nil)
        Tools::Config.instance.options['queues']['admin']['to'] + \
          "-#{instance.blank? ? @current_instance : instance}"
      rescue
        raise Errors::Tools::Cluster::QueueAdminTo
      end
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
ruby_rabbitmq_janus-2.6.0.pre.247 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-2.6.0.pre.246 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-2.6.0.pre.244 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-2.6.0.pre.240 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-2.6.0.pre.239 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-2.6.0.pre.238 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-2.6.0.pre.233 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-2.6.0.pre.229 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-2.6.0.pre.228 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-2.6.0.pre.227 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-2.6.0.pre.226 lib/rrj/tools/gem/cluster.rb