ruby_rabbitmq_janus 2.7.2.pre.310 → 2.7.2.pre.312
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rrj/models/active_record.rb +5 -5
- data/lib/rrj/models/mongoid.rb +5 -5
- data/lib/rrj/tools/bin/init.rb +19 -16
- data/lib/rrj/tools/gem/config.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eeaab1ae4e6c2b315a48d3dae5779098d70749ca0426fd7a7752dd95d0914bfe
|
4
|
+
data.tar.gz: 71f20a5706f6021718bf0491e3cea0afd1e84b308f03bfc61289286f6ec1c2e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfb041a82fc30acae2b546cf1455609b7b6e7bf5bd0bd509a6157860ae184232a9bfce67c509924aa1136e1b4e24a9ea63c11fc044f8f3094ce2329af65cf733
|
7
|
+
data.tar.gz: 8fed4a682590c5699402da12c9cedd700d2fe150ea48febcfdc1e16906bb0c50d95612914b2c57773fb0711bd45d0802dff74742c5ae2ce77c664d1af35569ca
|
@@ -9,8 +9,8 @@ module RubyRabbitmqJanus
|
|
9
9
|
# Store instance information for MongoID database
|
10
10
|
class JanusInstance < ::ActiveRecord::Base
|
11
11
|
include RubyRabbitmqJanus::Models::Instances
|
12
|
-
include RubyRabbitmqJanus::Models::Methods
|
13
|
-
include RubyRabbitmqJanus::Models::Callbacks
|
12
|
+
# include RubyRabbitmqJanus::Models::Methods
|
13
|
+
# include RubyRabbitmqJanus::Models::Callbacks
|
14
14
|
include RubyRabbitmqJanus::Models::Validations
|
15
15
|
|
16
16
|
self.primary_key = :id
|
@@ -21,9 +21,9 @@ module RubyRabbitmqJanus
|
|
21
21
|
alias_attribute :thread_id, :thread
|
22
22
|
alias_attribute :thread_id_adm, :thread_adm
|
23
23
|
|
24
|
-
after_create { callback_create_after }
|
25
|
-
after_update { callback_update_after }
|
26
|
-
after_destroy { callback_destroy_after }
|
24
|
+
# after_create { callback_create_after }
|
25
|
+
# after_update { callback_update_after }
|
26
|
+
# after_destroy { callback_destroy_after }
|
27
27
|
|
28
28
|
# Update attributes to document
|
29
29
|
#
|
data/lib/rrj/models/mongoid.rb
CHANGED
@@ -8,8 +8,8 @@ module RubyRabbitmqJanus
|
|
8
8
|
class JanusInstance
|
9
9
|
include Mongoid::Document
|
10
10
|
include RubyRabbitmqJanus::Models::Instances
|
11
|
-
include RubyRabbitmqJanus::Models::Methods
|
12
|
-
include RubyRabbitmqJanus::Models::Callbacks
|
11
|
+
# include RubyRabbitmqJanus::Models::Methods
|
12
|
+
# include RubyRabbitmqJanus::Models::Callbacks
|
13
13
|
include RubyRabbitmqJanus::Models::Validations
|
14
14
|
|
15
15
|
field :name, type: String, as: :title
|
@@ -20,9 +20,9 @@ module RubyRabbitmqJanus
|
|
20
20
|
|
21
21
|
alias_attribute :instance, :_id
|
22
22
|
|
23
|
-
set_callback(:create, :after) { callback_create_after }
|
24
|
-
set_callback(:update, :after) { callback_update_after }
|
25
|
-
set_callback(:destroy, :after) { callback_destroy_after }
|
23
|
+
# set_callback(:create, :after) { callback_create_after }
|
24
|
+
# set_callback(:update, :after) { callback_update_after }
|
25
|
+
# set_callback(:destroy, :after) { callback_destroy_after }
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
data/lib/rrj/tools/bin/init.rb
CHANGED
@@ -4,24 +4,27 @@
|
|
4
4
|
# then initialize binary
|
5
5
|
|
6
6
|
require 'rrj/rails' # defined?(::Rails::Engine)
|
7
|
-
require File.join(File.dirname(__FILE__), '..', '..', 'binary')
|
7
|
+
# require File.join(File.dirname(__FILE__), '..', '..', 'binary')
|
8
8
|
|
9
9
|
begin
|
10
|
-
bin = RubyRabbitmqJanus::Binary.new
|
11
|
-
Log.info \
|
12
|
-
|
13
|
-
|
14
|
-
rabbit = RubyRabbitmqJanus::Rabbit::Connect.new
|
15
|
-
rabbit.start
|
16
|
-
listener = RubyRabbitmqJanus::Rabbit::Listener::JanusInstance.new(rabbit)
|
17
|
-
Log.info 'Loop events provided by Janus queues'
|
18
|
-
loop do
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
end
|
10
|
+
# bin = RubyRabbitmqJanus::Binary.new
|
11
|
+
# Log.info \
|
12
|
+
# 'Prepare to listen events in queue : ' + \
|
13
|
+
# RubyRabbitmqJanus::Tools::Config.instance.queue_janus_instance
|
14
|
+
# rabbit = RubyRabbitmqJanus::Rabbit::Connect.new
|
15
|
+
# rabbit.start
|
16
|
+
# listener = RubyRabbitmqJanus::Rabbit::Listener::JanusInstance.new(rabbit)
|
17
|
+
# Log.info 'Loop events provided by Janus queues'
|
18
|
+
# loop do
|
19
|
+
# listener.listen_events do |event, response|
|
20
|
+
# Log.debug "Event : #{event}"
|
21
|
+
# Log.debug "Response : #{response.to_hash}"
|
22
|
+
# bin.update_instance(response.to_hash)
|
23
|
+
# end
|
24
|
+
# end
|
25
|
+
|
26
|
+
Log.info 'Listen Public queue to Janus'
|
27
|
+
loop {}
|
25
28
|
rescue => exception
|
26
29
|
Log.fatal '!! Fail to start RRJ Thread Janus Instance management !!'
|
27
30
|
Log.fatal exception
|
data/lib/rrj/tools/gem/config.rb
CHANGED
@@ -8,7 +8,8 @@ require 'erb'
|
|
8
8
|
%w[gem rabbit queues janus].each do |file|
|
9
9
|
require File.join('rrj', 'tools', 'gem', 'config', file)
|
10
10
|
end
|
11
|
-
%w[callbacks methods instances validations].each do |file|
|
11
|
+
# %w[callbacks methods instances validations].each do |file|
|
12
|
+
%w[instances validations].each do |file|
|
12
13
|
require File.join('rrj', 'models', 'concerns', file)
|
13
14
|
end
|
14
15
|
|