ruby_rabbitmq_janus 2.2.0.pre.179 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc2b31862c0708c674e7a21f98ae77061baaa722
4
- data.tar.gz: 2b771ef4c51d25bde097b7e4ced7e2b94f99932d
3
+ metadata.gz: 7f34cad1c72e7d7cb5737f806b66824a28f2ec84
4
+ data.tar.gz: ca95c3126aaf6f29cbb7b8c9dfcd4d7312a876bb
5
5
  SHA512:
6
- metadata.gz: a24227cb75c670aa8ec50c8954787b05ad66adf2706533f305556fb1ffa6f63c34e9f77f2e894bfc2d2f440aba7619f9082b519ffae4d73e433364a4556636ae
7
- data.tar.gz: da9961ca948a7d237d7266911ed4e2234b8d926d4fa264aa411caa0363875a7ecd0962ce59a0f4e79243ed84d7f3bd1a4f4b75876516e5a064573da6d492a8be
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
- raise Errors::Janus::KeepaliveInitializer::ID2Ref, thread
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
- janus = find_model
38
- send_messages_restart
39
- janus.set(session: @session)
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
- test_correlation(m_correlation, p_correlation(propertie)) do
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.pre.179
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-15 00:00:00.000000000 Z
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: 1.3.1
617
+ version: '0'
618
618
  requirements: []
619
619
  rubyforge_project:
620
620
  rubygems_version: 2.6.13