ruby_rabbitmq_janus 2.2.0.pre.179 → 2.2.0
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/errors/janus/processus/keepalive/initializer.rb +0 -6
- data/lib/rrj/errors/rabbit/publish/publisher.rb +0 -8
- data/lib/rrj/janus/processus/keepalive/keepalive_initializer.rb +1 -1
- data/lib/rrj/janus/processus/keepalive/keepalive_thread.rb +3 -8
- data/lib/rrj/rabbit/publish/publisher.rb +5 -12
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f34cad1c72e7d7cb5737f806b66824a28f2ec84
|
4
|
+
data.tar.gz: ca95c3126aaf6f29cbb7b8c9dfcd4d7312a876bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 077915cb4fb54a3d028202f4c953c105584c9c228c97fa54410ad1e47e37bb730fe0867ea26b5facfa49b0cd5e2450b85ba16266037728e4bd9664e84ae8f9d5
|
7
|
+
data.tar.gz: 61b33fab6237bb0b9c59d71d9b7fe48d87d1c14c5691f9048b26e24c4499748aa4233b634e21940f4d1a00eabfbef3ebceebfb7d4d716c8a730efbec1c3b06a2
|
@@ -18,12 +18,6 @@ module RubyRabbitmqJanus
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
class ID2ref < RubyRabbitmqJanus::Errors::Janus::BaseKeepaliveInitializer
|
22
|
-
def initialize(thread_id)
|
23
|
-
super "No thread with ID : #{thread_id}"
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
21
|
class Session < RubyRabbitmqJanus::Errors::Janus::BaseKeepaliveInitializer
|
28
22
|
def initialize
|
29
23
|
super 'Error return session number'
|
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# :reek:IrresponsibleModule
|
4
|
-
#
|
5
3
|
module RubyRabbitmqJanus
|
6
4
|
module Errors
|
7
5
|
module Rabbit
|
@@ -26,12 +24,6 @@ module RubyRabbitmqJanus
|
|
26
24
|
super 'Error for publish message'
|
27
25
|
end
|
28
26
|
end
|
29
|
-
|
30
|
-
class Testcorrelation < RubyRabbitmqJanus::Errors::Rabbit::BasePublish
|
31
|
-
def initialize(message, propertie)
|
32
|
-
super "Response correlation ID mismatch (#{message} != #{propertie})", :fatal
|
33
|
-
end
|
34
|
-
end
|
35
27
|
end
|
36
28
|
end
|
37
29
|
end
|
@@ -26,7 +26,7 @@ module RubyRabbitmqJanus
|
|
26
26
|
def self.thread(thread)
|
27
27
|
ObjectSpace._id2ref(thread)
|
28
28
|
rescue RangeError
|
29
|
-
|
29
|
+
Tools::Log.instance.fatal "No thread with ID : #{thread}"
|
30
30
|
end
|
31
31
|
|
32
32
|
# Give a session Integer his gem is instantiate.
|
@@ -34,9 +34,9 @@ module RubyRabbitmqJanus
|
|
34
34
|
# Restart session
|
35
35
|
def restart_session
|
36
36
|
Tools::Log.instance.warn 'Restart session ...'
|
37
|
-
|
38
|
-
|
39
|
-
|
37
|
+
@session = response_session
|
38
|
+
response_keepalive
|
39
|
+
find_model.set(session: @session)
|
40
40
|
rescue
|
41
41
|
raise Errors::Janus::KeepaliveThread::RestartSession
|
42
42
|
end
|
@@ -76,11 +76,6 @@ module RubyRabbitmqJanus
|
|
76
76
|
|
77
77
|
attr_reader :instance
|
78
78
|
|
79
|
-
def send_messages_restart
|
80
|
-
@session = response_session
|
81
|
-
response_keepalive
|
82
|
-
end
|
83
|
-
|
84
79
|
def prepare_kill_thread
|
85
80
|
@session = @message = nil
|
86
81
|
KeepaliveThread.instance_method(:kill).bind(self).call
|
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# rubocop:disable Style/GuardClause
|
4
|
-
|
5
3
|
module RubyRabbitmqJanus
|
6
4
|
module Rabbit
|
7
5
|
module Publisher
|
@@ -39,8 +37,12 @@ module RubyRabbitmqJanus
|
|
39
37
|
|
40
38
|
def subscribe_to_queue
|
41
39
|
reply.subscribe do |_delivery_info, propertie, payload|
|
42
|
-
|
40
|
+
propertie_correlation = p_correlation(propertie)
|
41
|
+
if m_correlation.eql?(propertie_correlation)
|
43
42
|
synchronize(payload)
|
43
|
+
else
|
44
|
+
Tools::Log.instance.error 'Response correlation ID mismatch (' \
|
45
|
+
"#{m_correlation}!=#{propertie_correlation})"
|
44
46
|
end
|
45
47
|
end
|
46
48
|
end
|
@@ -53,14 +55,6 @@ module RubyRabbitmqJanus
|
|
53
55
|
propertie.correlation_id
|
54
56
|
end
|
55
57
|
|
56
|
-
def test_correlation(m_cor, p_cor)
|
57
|
-
if m_cor.eql?(p_cor)
|
58
|
-
yield
|
59
|
-
else
|
60
|
-
raise Errors::Rabbit::Publish::TestCorrelation, m_cor, p_cor
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
58
|
def synchronize(payload)
|
65
59
|
lock.synchronize do
|
66
60
|
responses.push(JSON.parse(payload))
|
@@ -73,7 +67,6 @@ module RubyRabbitmqJanus
|
|
73
67
|
end
|
74
68
|
end
|
75
69
|
end
|
76
|
-
# rubocop:enable Style/GuardClause
|
77
70
|
|
78
71
|
require 'rrj/rabbit/publish/admin'
|
79
72
|
require 'rrj/rabbit/publish/exclusive'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_rabbitmq_janus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.0
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- VAILLANT Jeremy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -612,9 +612,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
612
612
|
version: '0'
|
613
613
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
614
614
|
requirements:
|
615
|
-
- - "
|
615
|
+
- - ">="
|
616
616
|
- !ruby/object:Gem::Version
|
617
|
-
version:
|
617
|
+
version: '0'
|
618
618
|
requirements: []
|
619
619
|
rubyforge_project:
|
620
620
|
rubygems_version: 2.6.13
|