gilmour-em-hiredis 0.3.0 → 0.3.1

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: 1c7d2fb57fb7ecea14121caf7c63409e225f5a3e
4
- data.tar.gz: be6da3ecb311f550675ecdd054a4b1aa8d5ea435
3
+ metadata.gz: bff9d2879a4dab3c06c811c8f5603ec6d410d833
4
+ data.tar.gz: 47a7690848aabc0a1fdb8a23dc4116d75e3c8bb1
5
5
  SHA512:
6
- metadata.gz: e1623301124a9b3551febaf10db4c58273022d8a39006467458113c74fe9fa0d09c900ee2685f17e014ea755c9e7715aa54edf2f2b5cca7e04579ae038abaa61
7
- data.tar.gz: b4d54cb1499261e94f0814886a3a40147c2a1dd9fcf6234023eb7dccf4a08e3becedc83052a349326cd496c9e5a76e5153d534fa7a542c112e0f9fd01903af78
6
+ metadata.gz: 8a73672bf42045e373eba238a40e8104624ebcd0c72b50e4cabe21278c8a8e4eed3779e6f1720dd706839f4196e80877c9b5946fa3f4546f80857310ccf0e038
7
+ data.tar.gz: df0fe23e77d9c72e9e6ce727c393f5445ca2567735f4bcc70c4751daefc177117edb914d1acc8cde0b7f1a73b8f1869bffb5d49df909a9f7cd82276ff84c2745
@@ -210,8 +210,15 @@ module EventMachine::Hiredis
210
210
  deferred.callback { |result| yield(result) } if block_given?
211
211
 
212
212
  if @connected
213
- @connection.send_command(sym, args)
214
- @defs.push(deferred)
213
+ res = @connection.send_command(sym, args)
214
+ # @connected can be in a stale state. send_command will fail and return
215
+ # 0 (if EM pure_ruby implmentation is not used). In that case, queue up
216
+ # the command once to be retried on reconnection
217
+ if res && res.kind_of?(Numeric) && res == 0
218
+ @command_queue << [deferred, sym, args]
219
+ else
220
+ @defs.push(deferred)
221
+ end
215
222
  elsif @failed
216
223
  deferred.fail(Error.new("Redis connection in failed state"))
217
224
  else
@@ -1,5 +1,5 @@
1
1
  module EventMachine
2
2
  module Hiredis
3
- VERSION = "0.3.0"
3
+ VERSION = "0.3.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gilmour-em-hiredis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martyn Loughran
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-06-13 00:00:00.000000000 Z
12
+ date: 2015-06-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: eventmachine