sneakers_packer 0.1.3 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff389357c884d101bf40e88ca9aefe4bde8b3456
4
- data.tar.gz: 7a8798e701af7d03af51bd8642f60490c4725706
3
+ metadata.gz: b6b98083ec7e1c36b50a533f25a6491b18ea1d82
4
+ data.tar.gz: 96984ee06ee6d2e12700f5a7c74f199b11852766
5
5
  SHA512:
6
- metadata.gz: 2405dd49c34a9d5ac164898c9e0acc21678550144b951f2ddab440e628741b76f2bd623d3bb2be7037897b66313fb53de7effc790d099616e17412fe027b644c
7
- data.tar.gz: 039f97e4b51ff74623cab87a951e184edf9e7c22540ae252aa9766901f408c8cf22c95fc82db47706ab3998d457cfaa50c3919a74d1e2dcd0171e5ae08349087
6
+ metadata.gz: a599887e7d24b3de1753976db48c13cb622849facf3cd8137b515c3729609652133342fbaa2d55148b25810574972f5ca5a57dd34b5252eebe50b58c003b2778
7
+ data.tar.gz: 9b6bc6df8d3b9ae5ed76c80b4819b3b213062b39937b619b19ca211ad9b980d092761a245cf406081b53288f544bcc93a5e84ac3c8d193e7c03dad13f5a14f1a
@@ -1,3 +1,8 @@
1
+ ## 0.1.4
2
+
3
+ * Support automatically_recover of RabbitMQ for rpc.
4
+ * Dependency for sneakers 1.0.0+.
5
+
1
6
  ## 0.1.3
2
7
 
3
8
  * [Bugfix] Change RemoteCallTimeoutError's parent to StandardError.
@@ -8,6 +8,7 @@ module SneakersPacker
8
8
  def initialize(publisher)
9
9
  @publisher = publisher
10
10
  channel, exchange = fetch_channel_and_exchange
11
+ @queue_name = "rpc.#{SecureRandom.uuid}"
11
12
  @consumer = build_reply_queue(channel, exchange)
12
13
  end
13
14
 
@@ -35,7 +36,7 @@ module SneakersPacker
35
36
  lock.synchronize { condition.wait(lock, timeout) }
36
37
 
37
38
  if response == NO_RESPONSE
38
- raise RemoteCallTimeoutError, "remote call timeout. exceed #{timeout} seconds."
39
+ raise RemoteCallTimeoutError, "Remote call timeouts.Exceed #{timeout} seconds."
39
40
  else
40
41
  response
41
42
  end
@@ -49,13 +50,15 @@ module SneakersPacker
49
50
  exchange = nil
50
51
 
51
52
  @publisher.instance_eval do
52
- # ensure_connection connection first
53
- @mutex.synchronize do
54
- unless connected?
55
- ensure_connection!
56
- reconnected = true
57
- channel = @channel
58
- exchange = @exchange
53
+ if @bunny.nil? || !@bunny.automatically_recover?
54
+ # ensure_connection connection first
55
+ @mutex.synchronize do
56
+ unless connected?
57
+ ensure_connection!
58
+ reconnected = true
59
+ channel = @channel
60
+ exchange = @exchange
61
+ end
59
62
  end
60
63
  end
61
64
  end
@@ -69,7 +72,7 @@ module SneakersPacker
69
72
  def build_reply_queue(channel, exchange)
70
73
  @channel, @exchange = channel, exchange
71
74
 
72
- @reply_queue = channel.queue("", exclusive: true)
75
+ @reply_queue = channel.queue(@queue_name, exclusive: true)
73
76
  @reply_queue.bind(exchange, routing_key: @reply_queue.name)
74
77
 
75
78
  @lock = Mutex.new
@@ -1,3 +1,3 @@
1
1
  module SneakersPacker
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "sneakers", "~> 2.3.5"
21
+ spec.add_dependency "sneakers", ">= 1.0.0"
22
22
  spec.add_dependency "multi_json"
23
23
 
24
24
  spec.add_development_dependency "bundler", "~> 1.11"
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sneakers_packer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - vincent
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-25 00:00:00.000000000 Z
11
+ date: 2016-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sneakers
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 2.3.5
19
+ version: 1.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 2.3.5
26
+ version: 1.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: multi_json
29
29
  requirement: !ruby/object:Gem::Requirement