lib/rrj/tools/bin/init.rb in ruby_rabbitmq_janus-2.6.0.pre.244 vs lib/rrj/tools/bin/init.rb in ruby_rabbitmq_janus-2.6.0.pre.246
- old
+ new
@@ -19,11 +19,25 @@
Log.info RubyRabbitmqJanus::BANNER
require File.join(File.dirname(__FILE__), '..', '..', 'binary')
begin
+ Log.info 'Load events public queue classes'
bin = RubyRabbitmqJanus::Binary.new
+ Log.info "Load file : #{File.join(Dir.pwd, LISTENER_PATH)}"
+ require File.join(Dir.pwd, LISTENER_PATH)
+
+ Log.info 'Listen public queue in thread'
+ actions = RubyRabbitmqJanus::ActionEvents.new.actions
+ RubyRabbitmqJanus::Janus::Concurrencies::Event.instance.run(&actions)
+rescue => exception
+ Log.fatal '!! Fail to start RRJ Thread listen public queue !!'
+ Log.fatal exception
+ exit 1
+end
+
+begin
Log.info \
'Prepare to listen events in queue : ' + \
RubyRabbitmqJanus::Tools::Config.instance.queue_janus_instance
rabbit = RubyRabbitmqJanus::Rabbit::Connect.new
rabbit.start
@@ -35,9 +49,9 @@
Log.debug "Response : #{response.to_hash}"
bin.update_instance(response.to_hash)
end
end
rescue => exception
- Log.fatal '!! Fail to start RRJ threads !!'
+ Log.fatal '!! Fail to start RRJ Thread Janus Instance management !!'
Log.fatal exception
exit 1
end