Class: RubyRabbitmqJanus::Tools::Cluster
- Inherits:
-
Object
- Object
- RubyRabbitmqJanus::Tools::Cluster
- Includes:
- Singleton
- Defined in:
- lib/rrj/tools/gem/cluster.rb
Overview
# Manage Janus instance
Instance Method Summary collapse
-
#initialize ⇒ Cluster
constructor
Initialize object for managing each instance to Janus.
-
#queue_admin_to(instance = nil) ⇒ Object
Specify a name to admin queue.
-
#queue_to(instance = nil) ⇒ Object
Specify a name to queue.
Constructor Details
#initialize ⇒ Cluster
Initialize object for managing each instance to Janus
12 13 14 |
# File 'lib/rrj/tools/gem/cluster.rb', line 12 def initialize @current_instance = nil end |
Instance Method Details
#queue_admin_to(instance = nil) ⇒ Object
Specify a name to admin queue
25 26 27 28 29 30 |
# File 'lib/rrj/tools/gem/cluster.rb', line 25 def queue_admin_to(instance = nil) Tools::Config.instance.['queues']['admin']['to'] + \ "-#{instance.blank? ? @current_instance : instance}" rescue raise Errors::Tools::Cluster::QueueAdminTo end |
#queue_to(instance = nil) ⇒ Object
Specify a name to queue
17 18 19 20 21 22 |
# File 'lib/rrj/tools/gem/cluster.rb', line 17 def queue_to(instance = nil) Tools::Config.instance.['queues']['standard']['to'] + \ "-#{instance.blank? ? @current_instance : instance}" rescue raise Errors::Tools::Cluster::QueueTo end |