Class: Vx::Common::AMQP::CLI
- Inherits:
-
Object
- Object
- Vx::Common::AMQP::CLI
- Defined in:
- lib/vx/common/amqp/cli.rb
Instance Method Summary collapse
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Constructor Details
#initialize ⇒ CLI
Returns a new instance of CLI.
13 14 15 |
# File 'lib/vx/common/amqp/cli.rb', line 13 def initialize @options = end |
Instance Method Details
#run ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/vx/common/amqp/cli.rb', line 17 def run require_before_executing load_consumers consumers = find_consumers.inject({}) do |a,c| a[c] = 2 a end supervisor = Common::AMQP::Supervisor::Threaded.new consumers.each do |k,v| v.times do |n| supervisor.add k, :subscribe, n end end supervisor.run end |