sneakers_packer 0.1.2 → 0.1.3
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/CHANGELOG.md +4 -0
- data/README.md +2 -1
- data/lib/sneakers_packer/rpc_client.rb +6 -4
- data/lib/sneakers_packer/version.rb +1 -1
- data/lib/sneakers_packer.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff389357c884d101bf40e88ca9aefe4bde8b3456
|
4
|
+
data.tar.gz: 7a8798e701af7d03af51bd8642f60490c4725706
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2405dd49c34a9d5ac164898c9e0acc21678550144b951f2ddab440e628741b76f2bd623d3bb2be7037897b66313fb53de7effc790d099616e17412fe027b644c
|
7
|
+
data.tar.gz: 039f97e4b51ff74623cab87a951e184edf9e7c22540ae252aa9766901f408c8cf22c95fc82db47706ab3998d457cfaa50c3919a74d1e2dcd0171e5ae08349087
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# SneakersPacker
|
2
2
|
|
3
|
-
SneakersPacker is a gem for using sneakers to 3 message communication patterns job message, broadcast and RPC(remote procedure call).
|
3
|
+
SneakersPacker is a gem for using sneakers to realize 3 message communication patterns job message, broadcast and RPC(remote procedure call).
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -121,6 +121,7 @@ remote call with custom timeouit.
|
|
121
121
|
```
|
122
122
|
|
123
123
|
**See the gem doc or source code for accurate detail**
|
124
|
+
**You can see the demo app for SneakersPacker by** [Sneakers](https://github.com/xiewenwei/sneakers_demo).
|
124
125
|
|
125
126
|
## Development
|
126
127
|
|
@@ -11,6 +11,8 @@ module SneakersPacker
|
|
11
11
|
@consumer = build_reply_queue(channel, exchange)
|
12
12
|
end
|
13
13
|
|
14
|
+
NO_RESPONSE = :__no_resp
|
15
|
+
|
14
16
|
# call remote service via rabbitmq rpc
|
15
17
|
# @param name route_key for service
|
16
18
|
# @param message
|
@@ -19,7 +21,7 @@ module SneakersPacker
|
|
19
21
|
# @raise RemoteCallTimeoutError if timeout
|
20
22
|
def call(name, message, options = {})
|
21
23
|
self.call_id = SecureRandom.uuid
|
22
|
-
self.response =
|
24
|
+
self.response = NO_RESPONSE
|
23
25
|
|
24
26
|
ensure_reply_queue!
|
25
27
|
|
@@ -32,10 +34,10 @@ module SneakersPacker
|
|
32
34
|
|
33
35
|
lock.synchronize { condition.wait(lock, timeout) }
|
34
36
|
|
35
|
-
if response
|
36
|
-
|
37
|
+
if response == NO_RESPONSE
|
38
|
+
raise RemoteCallTimeoutError, "remote call timeout. exceed #{timeout} seconds."
|
37
39
|
else
|
38
|
-
|
40
|
+
response
|
39
41
|
end
|
40
42
|
end
|
41
43
|
|
data/lib/sneakers_packer.rb
CHANGED
@@ -7,7 +7,7 @@ require "sneakers_packer/rpc_worker"
|
|
7
7
|
require "sneakers_packer/rpc_client"
|
8
8
|
|
9
9
|
module SneakersPacker
|
10
|
-
class RemoteCallTimeoutError <
|
10
|
+
class RemoteCallTimeoutError < StandardError; end
|
11
11
|
|
12
12
|
# sender message to sneaker exchange
|
13
13
|
# @param name route_key for message
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sneakers_packer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
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-
|
11
|
+
date: 2016-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sneakers
|