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-3.0.0.pre.336 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-3.0.0.pre.335 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-3.0.0.pre.334 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-3.0.0.pre.330 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-3.0.0.pre.328 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-3.0.0.pre.327 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-2.7.2 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-2.7.2.pre.322 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-2.7.2.pre.320 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-2.7.2.pre.319 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-2.7.2.pre.318 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-2.7.2.pre.317 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-2.7.2.pre.316 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-2.7.2.pre.315 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-2.7.2.pre.314 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-2.7.2.pre.312 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-2.7.2.pre.310 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-2.7.2.pre.309 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-2.7.2.pre.308 lib/rrj/tools/gem/cluster.rb
ruby_rabbitmq_janus-2.7.2.pre.307 lib/rrj/tools/gem/cluster.rb