redis-rpc 1.0.3 → 1.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9f7f8124ddfe3927903b239fe8f3285dd82a933a
4
- data.tar.gz: d1adf6844fd8ce34f835a6fc889875dbf47c362b
3
+ metadata.gz: f0e33433f97014ca9e292fc721e48271ff83ec58
4
+ data.tar.gz: ea4b5130c90bbb44a926a3e88e5be2d46adb0189
5
5
  SHA512:
6
- metadata.gz: 095bf7c31bf0eafdf4d067fe0af0ca6b2938b2ffd590dce73c56e786531321d0b5368519c129423358cb2e1c1dddfa07643a23c467df84df882dd5eea9589d65
7
- data.tar.gz: 784810d273cef3e441c4ab729c8c3601060bc2ee8c8e540adc46fda0287300a98bbaf421bafb0e49957c6d604e6e2c86a16daab7fb639503b5d50cdabad50b10
6
+ metadata.gz: f08569b5d4f2186c956efd1bb195adc56577269551c823645d0affad65c309a9efe1808b59d125e7254580ed5deb4ab236d2c8c22a40c86782b89b862c94efa2
7
+ data.tar.gz: fa9ebbd23ebf9912181f1a09fe7a241892be87d1dc985f2757a640ca14770506248db2c2f87f6fa28f6a3c702f7250140a25092c9baea0698bd75575479b88d4
data/Gemfile.lock CHANGED
@@ -1,25 +1,30 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- redis-rpc (1.0.3)
4
+ redis-rpc (1.1.0)
5
5
  multi_json (~> 1.3)
6
6
  redis
7
7
 
8
8
  GEM
9
9
  remote: http://rubygems.org/
10
10
  specs:
11
- diff-lcs (1.1.3)
11
+ diff-lcs (1.3)
12
12
  multi_json (1.13.1)
13
13
  rake (0.9.2)
14
14
  redis (4.0.3)
15
- rspec (2.9.0)
16
- rspec-core (~> 2.9.0)
17
- rspec-expectations (~> 2.9.0)
18
- rspec-mocks (~> 2.9.0)
19
- rspec-core (2.9.0)
20
- rspec-expectations (2.9.1)
21
- diff-lcs (~> 1.1.3)
22
- rspec-mocks (2.9.0)
15
+ rspec (3.8.0)
16
+ rspec-core (~> 3.8.0)
17
+ rspec-expectations (~> 3.8.0)
18
+ rspec-mocks (~> 3.8.0)
19
+ rspec-core (3.8.0)
20
+ rspec-support (~> 3.8.0)
21
+ rspec-expectations (3.8.2)
22
+ diff-lcs (>= 1.2.0, < 2.0)
23
+ rspec-support (~> 3.8.0)
24
+ rspec-mocks (3.8.0)
25
+ diff-lcs (>= 1.2.0, < 2.0)
26
+ rspec-support (~> 3.8.0)
27
+ rspec-support (3.8.0)
23
28
 
24
29
  PLATFORMS
25
30
  ruby
data/lib/redis-rpc.rb CHANGED
@@ -68,7 +68,7 @@ module RedisRpc
68
68
  raise MalformedResponseException, rpc_response unless rpc_response.has_key? 'return_value'
69
69
  return rpc_response['return_value']
70
70
 
71
- rescue TimeoutException
71
+ rescue TimeoutException, SignalException
72
72
  # stale request cleanup
73
73
  @redis_server.lrem @message_queue, 0, rpc_raw_request
74
74
  raise $!
@@ -1,3 +1,3 @@
1
1
  module RedisRpc
2
- VERSION = "1.0.3"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -0,0 +1,16 @@
1
+ require File.expand_path( '../spec_helper.rb', __FILE__ )
2
+
3
+ describe RedisRpc::Client do
4
+ let(:client){ RedisRpc::Client.new( $REDIS, 'example', 1) }
5
+
6
+ context "terminated" do
7
+ it "clear the backlog" do
8
+ allow($REDIS).to receive(:blpop).and_raise SignalException.new("SIGTERM")
9
+ expect {
10
+ client.perform
11
+ }.to raise_error SignalException
12
+
13
+ expect($REDIS.llen("example")).to eq 0
14
+ end
15
+ end
16
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-rpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phuong Nguyen
@@ -125,6 +125,7 @@ files:
125
125
  - lib/redis-rpc/version.rb
126
126
  - redis-rpc.gemspec
127
127
  - spec/calculator_spec.rb
128
+ - spec/client_spec.rb
128
129
  - spec/redis-test.conf
129
130
  - spec/spec_helper.rb
130
131
  homepage: http://github.com/phuongnd08/redis-rpc-ruby
@@ -153,5 +154,6 @@ specification_version: 4
153
154
  summary: Lightweight RPC for Redis
154
155
  test_files:
155
156
  - spec/calculator_spec.rb
157
+ - spec/client_spec.rb
156
158
  - spec/redis-test.conf
157
159
  - spec/spec_helper.rb