lagomorph 0.0.5 → 0.0.6
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/lagomorph/rpc_call.rb +5 -1
- data/lib/lagomorph/version.rb +1 -1
- data/spec/lagomorph_spec.rb +5 -0
- 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: 483bc1b6e1a97b531654120b767eff3201166782
|
4
|
+
data.tar.gz: 07e0501db9e080fa6e60f619b5c976528b70f6b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03b13faa49e5c457d4e79676a28e40ad8bde4d2c7ce0ed659504847490b5879398a3633ab770b9248fdb19733f3d3728d62d0a32556f02035c5d10b57cfc3c71
|
7
|
+
data.tar.gz: d175e19314090d8d766b40da4486026840c908213ce5ceb2fea927d0ceedb86ae66efcea25259fd16fdc64f2e61b1d01eca9c1778cc93aa393e7c47be456d89f
|
data/lib/lagomorph/rpc_call.rb
CHANGED
@@ -24,7 +24,11 @@ module Lagomorph
|
|
24
24
|
publish_rpc_call(payload, correlation_id)
|
25
25
|
response = block_till_receive_response(correlation_id)
|
26
26
|
|
27
|
-
|
27
|
+
if response.key?('result')
|
28
|
+
response['result']
|
29
|
+
else
|
30
|
+
fail(RpcError, response.fetch('error', 'Unknown error'))
|
31
|
+
end
|
28
32
|
end
|
29
33
|
|
30
34
|
def close_channel
|
data/lib/lagomorph/version.rb
CHANGED
data/spec/lagomorph_spec.rb
CHANGED
@@ -60,6 +60,11 @@ describe 'a Lagomorph RPC process' do
|
|
60
60
|
it { expect(result).to eq 'test' }
|
61
61
|
end
|
62
62
|
|
63
|
+
context 'when a worker for an rpc call yields a nil result' do
|
64
|
+
let(:result) { rpc_call.dispatch(queue, 'echo', nil) }
|
65
|
+
it { expect(result).to eq nil }
|
66
|
+
end
|
67
|
+
|
63
68
|
context 'when a generate_failure rpc call is made on the ping queue' do
|
64
69
|
let(:result) { rpc_call.dispatch(queue, 'generate_failure') }
|
65
70
|
it { expect { result }.to raise_error Lagomorph::RpcError,
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lagomorph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alessandro Berardi
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-11-
|
12
|
+
date: 2014-11-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|