# frozen_string_literal: true module RubyRabbitmqJanus module Tools # @author VAILLANT Jeremy # # 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