finsync_redis 3.3.5
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 +7 -0
- data/.gitignore +16 -0
- data/.travis/Gemfile +11 -0
- data/.travis.yml +89 -0
- data/.yardopts +3 -0
- data/CHANGELOG.md +373 -0
- data/Gemfile +4 -0
- data/LICENSE +20 -0
- data/README.md +410 -0
- data/Rakefile +87 -0
- data/benchmarking/logging.rb +71 -0
- data/benchmarking/pipeline.rb +51 -0
- data/benchmarking/speed.rb +21 -0
- data/benchmarking/suite.rb +24 -0
- data/benchmarking/worker.rb +71 -0
- data/examples/basic.rb +15 -0
- data/examples/consistency.rb +114 -0
- data/examples/dist_redis.rb +43 -0
- data/examples/incr-decr.rb +17 -0
- data/examples/list.rb +26 -0
- data/examples/pubsub.rb +37 -0
- data/examples/sentinel/sentinel.conf +9 -0
- data/examples/sentinel/start +49 -0
- data/examples/sentinel.rb +41 -0
- data/examples/sets.rb +36 -0
- data/examples/unicorn/config.ru +3 -0
- data/examples/unicorn/unicorn.rb +20 -0
- data/lib/redis/client.rb +590 -0
- data/lib/redis/connection/command_helper.rb +44 -0
- data/lib/redis/connection/hiredis.rb +66 -0
- data/lib/redis/connection/registry.rb +12 -0
- data/lib/redis/connection/ruby.rb +429 -0
- data/lib/redis/connection/synchrony.rb +133 -0
- data/lib/redis/connection.rb +9 -0
- data/lib/redis/distributed.rb +873 -0
- data/lib/redis/errors.rb +40 -0
- data/lib/redis/hash_ring.rb +132 -0
- data/lib/redis/pipeline.rb +141 -0
- data/lib/redis/subscribe.rb +91 -0
- data/lib/redis/version.rb +3 -0
- data/lib/redis.rb +2788 -0
- data/redis.gemspec +44 -0
- data/test/bitpos_test.rb +69 -0
- data/test/blocking_commands_test.rb +42 -0
- data/test/client_test.rb +59 -0
- data/test/command_map_test.rb +30 -0
- data/test/commands_on_hashes_test.rb +21 -0
- data/test/commands_on_hyper_log_log_test.rb +21 -0
- data/test/commands_on_lists_test.rb +20 -0
- data/test/commands_on_sets_test.rb +77 -0
- data/test/commands_on_sorted_sets_test.rb +137 -0
- data/test/commands_on_strings_test.rb +101 -0
- data/test/commands_on_value_types_test.rb +133 -0
- data/test/connection_handling_test.rb +277 -0
- data/test/connection_test.rb +57 -0
- data/test/db/.gitkeep +0 -0
- data/test/distributed_blocking_commands_test.rb +46 -0
- data/test/distributed_commands_on_hashes_test.rb +10 -0
- data/test/distributed_commands_on_hyper_log_log_test.rb +33 -0
- data/test/distributed_commands_on_lists_test.rb +22 -0
- data/test/distributed_commands_on_sets_test.rb +83 -0
- data/test/distributed_commands_on_sorted_sets_test.rb +18 -0
- data/test/distributed_commands_on_strings_test.rb +59 -0
- data/test/distributed_commands_on_value_types_test.rb +95 -0
- data/test/distributed_commands_requiring_clustering_test.rb +164 -0
- data/test/distributed_connection_handling_test.rb +23 -0
- data/test/distributed_internals_test.rb +79 -0
- data/test/distributed_key_tags_test.rb +52 -0
- data/test/distributed_persistence_control_commands_test.rb +26 -0
- data/test/distributed_publish_subscribe_test.rb +92 -0
- data/test/distributed_remote_server_control_commands_test.rb +66 -0
- data/test/distributed_scripting_test.rb +102 -0
- data/test/distributed_sorting_test.rb +20 -0
- data/test/distributed_test.rb +58 -0
- data/test/distributed_transactions_test.rb +32 -0
- data/test/encoding_test.rb +18 -0
- data/test/error_replies_test.rb +59 -0
- data/test/fork_safety_test.rb +65 -0
- data/test/helper.rb +232 -0
- data/test/helper_test.rb +24 -0
- data/test/internals_test.rb +417 -0
- data/test/lint/blocking_commands.rb +150 -0
- data/test/lint/hashes.rb +162 -0
- data/test/lint/hyper_log_log.rb +60 -0
- data/test/lint/lists.rb +143 -0
- data/test/lint/sets.rb +140 -0
- data/test/lint/sorted_sets.rb +316 -0
- data/test/lint/strings.rb +260 -0
- data/test/lint/value_types.rb +122 -0
- data/test/persistence_control_commands_test.rb +26 -0
- data/test/pipelining_commands_test.rb +242 -0
- data/test/publish_subscribe_test.rb +282 -0
- data/test/remote_server_control_commands_test.rb +118 -0
- data/test/scanning_test.rb +413 -0
- data/test/scripting_test.rb +78 -0
- data/test/sentinel_command_test.rb +80 -0
- data/test/sentinel_test.rb +255 -0
- data/test/sorting_test.rb +59 -0
- data/test/ssl_test.rb +73 -0
- data/test/support/connection/hiredis.rb +1 -0
- data/test/support/connection/ruby.rb +1 -0
- data/test/support/connection/synchrony.rb +17 -0
- data/test/support/redis_mock.rb +130 -0
- data/test/support/ssl/gen_certs.sh +31 -0
- data/test/support/ssl/trusted-ca.crt +25 -0
- data/test/support/ssl/trusted-ca.key +27 -0
- data/test/support/ssl/trusted-cert.crt +81 -0
- data/test/support/ssl/trusted-cert.key +28 -0
- data/test/support/ssl/untrusted-ca.crt +26 -0
- data/test/support/ssl/untrusted-ca.key +27 -0
- data/test/support/ssl/untrusted-cert.crt +82 -0
- data/test/support/ssl/untrusted-cert.key +28 -0
- data/test/support/wire/synchrony.rb +24 -0
- data/test/support/wire/thread.rb +5 -0
- data/test/synchrony_driver.rb +88 -0
- data/test/test.conf.erb +9 -0
- data/test/thread_safety_test.rb +62 -0
- data/test/transactions_test.rb +264 -0
- data/test/unknown_commands_test.rb +14 -0
- data/test/url_param_test.rb +138 -0
- metadata +202 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: df2b194176f1b77bd1e97fea587c5f3324099e9a
|
4
|
+
data.tar.gz: 58ec30cb9d41dec16bd2ff4c27cf4b69c148f14b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2ee8918f0d99557e750a9585299fe10c4439366b6b28abd8bf28cf15e42bb1363e4aa6b6f9ef74eb650035d156d203e8ce657462b5bc95e27254bbfb2bae0895
|
7
|
+
data.tar.gz: 3f3860b2d3ff043eb66a48180c429df389a49fdd1cdd47e1a08ee6f193c6e881fab481bc7b509d06df588aeaf80043cfb4d51a831de57077c49068d7a2d61929
|
data/.gitignore
ADDED
data/.travis/Gemfile
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
language: ruby
|
2
|
+
|
3
|
+
rvm:
|
4
|
+
- 1.8.7
|
5
|
+
- 1.9.3
|
6
|
+
- 2.0
|
7
|
+
- 2.1
|
8
|
+
- 2.2
|
9
|
+
- 2.3.0
|
10
|
+
- jruby-18mode
|
11
|
+
- jruby-19mode
|
12
|
+
- jruby-9.0.5.0
|
13
|
+
- rbx-2
|
14
|
+
|
15
|
+
gemfile: ".travis/Gemfile"
|
16
|
+
|
17
|
+
sudo: false
|
18
|
+
|
19
|
+
env:
|
20
|
+
global:
|
21
|
+
- VERBOSE=true
|
22
|
+
- TIMEOUT=1
|
23
|
+
matrix:
|
24
|
+
- conn=ruby REDIS_BRANCH=3.0
|
25
|
+
- conn=ruby REDIS_BRANCH=3.2
|
26
|
+
- conn=hiredis REDIS_BRANCH=3.0
|
27
|
+
- conn=hiredis REDIS_BRANCH=3.2
|
28
|
+
- conn=synchrony REDIS_BRANCH=3.0
|
29
|
+
- conn=synchrony REDIS_BRANCH=3.2
|
30
|
+
- conn=ruby REDIS_BRANCH=unstable
|
31
|
+
|
32
|
+
branches:
|
33
|
+
only:
|
34
|
+
- master
|
35
|
+
|
36
|
+
matrix:
|
37
|
+
exclude:
|
38
|
+
# hiredis
|
39
|
+
- rvm: jruby-18mode
|
40
|
+
gemfile: .travis/Gemfile
|
41
|
+
env: conn=hiredis REDIS_BRANCH=3.0
|
42
|
+
- rvm: jruby-18mode
|
43
|
+
gemfile: .travis/Gemfile
|
44
|
+
env: conn=hiredis REDIS_BRANCH=3.2
|
45
|
+
- rvm: jruby-19mode
|
46
|
+
gemfile: .travis/Gemfile
|
47
|
+
env: conn=hiredis REDIS_BRANCH=3.0
|
48
|
+
- rvm: jruby-19mode
|
49
|
+
gemfile: .travis/Gemfile
|
50
|
+
env: conn=hiredis REDIS_BRANCH=3.2
|
51
|
+
- rvm: jruby-9.0.5.0
|
52
|
+
gemfile: .travis/Gemfile
|
53
|
+
env: conn=hiredis REDIS_BRANCH=3.0
|
54
|
+
- rvm: jruby-9.0.5.0
|
55
|
+
gemfile: .travis/Gemfile
|
56
|
+
env: conn=hiredis REDIS_BRANCH=3.2
|
57
|
+
|
58
|
+
# synchrony
|
59
|
+
- rvm: 1.8.7
|
60
|
+
gemfile: .travis/Gemfile
|
61
|
+
env: conn=synchrony REDIS_BRANCH=3.0
|
62
|
+
- rvm: 1.8.7
|
63
|
+
gemfile: .travis/Gemfile
|
64
|
+
env: conn=synchrony REDIS_BRANCH=3.2
|
65
|
+
- rvm: jruby-18mode
|
66
|
+
gemfile: .travis/Gemfile
|
67
|
+
env: conn=synchrony REDIS_BRANCH=3.0
|
68
|
+
- rvm: jruby-18mode
|
69
|
+
gemfile: .travis/Gemfile
|
70
|
+
env: conn=synchrony REDIS_BRANCH=3.2
|
71
|
+
- rvm: jruby-19mode
|
72
|
+
gemfile: .travis/Gemfile
|
73
|
+
env: conn=synchrony REDIS_BRANCH=3.0
|
74
|
+
- rvm: jruby-19mode
|
75
|
+
gemfile: .travis/Gemfile
|
76
|
+
env: conn=synchrony REDIS_BRANCH=3.2
|
77
|
+
- rvm: jruby-9.0.5.0
|
78
|
+
gemfile: .travis/Gemfile
|
79
|
+
env: conn=synchrony REDIS_BRANCH=3.0
|
80
|
+
- rvm: jruby-9.0.5.0
|
81
|
+
gemfile: .travis/Gemfile
|
82
|
+
env: conn=synchrony REDIS_BRANCH=3.2
|
83
|
+
allow_failures:
|
84
|
+
- rvm: rbx-2
|
85
|
+
|
86
|
+
notifications:
|
87
|
+
irc:
|
88
|
+
- irc.freenode.net#redis-rb
|
89
|
+
email: false
|
data/.yardopts
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,373 @@
|
|
1
|
+
# 3.3.5
|
2
|
+
|
3
|
+
* Fixed Ruby 1.8 compatibility after backporting `Redis#connection`. See #719.
|
4
|
+
|
5
|
+
# 3.3.4
|
6
|
+
|
7
|
+
* `Redis#connection` returns a hash with connection information.
|
8
|
+
You shouldn't need to call `Redis#_client`, ever.
|
9
|
+
|
10
|
+
# 3.3.3
|
11
|
+
|
12
|
+
* Improved timeout handling after dropping Timeout module.
|
13
|
+
|
14
|
+
# 3.3.2
|
15
|
+
|
16
|
+
* Added support for SPOP with COUNT. See #628.
|
17
|
+
|
18
|
+
* Fixed connection glitches when using SSL. See #644.
|
19
|
+
|
20
|
+
# 3.3.1
|
21
|
+
|
22
|
+
* Remove usage of Timeout::timeout, refactor into using low level non-blocking writes.
|
23
|
+
This fixes a memory leak due to Timeout creating threads on each invocation.
|
24
|
+
|
25
|
+
# 3.3.0
|
26
|
+
|
27
|
+
* Added support for SSL/TLS. Redis doesn't support SSL natively, so you still
|
28
|
+
need to run a terminating proxy on Redis' side. See #496.
|
29
|
+
|
30
|
+
* Added `read_timeout` and `write_timeout` options. See #437, #482.
|
31
|
+
|
32
|
+
* Added support for pub/sub with timeouts. See #329.
|
33
|
+
|
34
|
+
* Added `Redis#call`, `Redis#queue` and `Redis#commit` as a more minimal API to
|
35
|
+
the client.
|
36
|
+
|
37
|
+
* Deprecated `Redis#disconnect!` in favor of `Redis#close`.
|
38
|
+
|
39
|
+
# 3.2.2
|
40
|
+
|
41
|
+
* Added support for `ZADD` options `NX`, `XX`, `CH`, `INCR`. See #547.
|
42
|
+
|
43
|
+
* Added support for sentinel commands. See #556.
|
44
|
+
|
45
|
+
* New `:id` option allows you to identify the client against Redis. See #510.
|
46
|
+
|
47
|
+
* `Redis::Distributed` will raise when adding two nodes with the same ID.
|
48
|
+
See #354.
|
49
|
+
|
50
|
+
# 3.2.1
|
51
|
+
|
52
|
+
* Added support for `PUBSUB` command.
|
53
|
+
|
54
|
+
* More low-level socket errors are now raised as `CannotConnectError`.
|
55
|
+
|
56
|
+
* Added `:connect_timeout` option.
|
57
|
+
|
58
|
+
* Added support for `:limit` option for `ZREVRANGEBYLEX`.
|
59
|
+
|
60
|
+
* Fixed an issue where connections become inconsistent when using Ruby's
|
61
|
+
Timeout module outside of the client (see #501, #502).
|
62
|
+
|
63
|
+
* Added `Redis#disconnect!` as a public-API way of disconnecting the client
|
64
|
+
(without needing to use `QUIT`). See #506.
|
65
|
+
|
66
|
+
* Fixed Sentinel support with Hiredis.
|
67
|
+
|
68
|
+
* Fixed Sentinel support when using authentication and databases.
|
69
|
+
|
70
|
+
* Improved resilience when trying to contact sentinels.
|
71
|
+
|
72
|
+
# 3.2.0
|
73
|
+
|
74
|
+
* Redis Sentinel support.
|
75
|
+
|
76
|
+
# 3.1.0
|
77
|
+
|
78
|
+
* Added debug log sanitization (#428).
|
79
|
+
|
80
|
+
* Added support for HyperLogLog commands (Redis 2.8.9, #432).
|
81
|
+
|
82
|
+
* Added support for `BITPOS` command (Redis 2.9.11, #412).
|
83
|
+
|
84
|
+
* The client will now automatically reconnect after a fork (#414).
|
85
|
+
|
86
|
+
* If you want to disable the fork-safety check and prefer to share the
|
87
|
+
connection across child processes, you can now pass the `inherit_socket`
|
88
|
+
option (#409).
|
89
|
+
|
90
|
+
* If you want the client to attempt to reconnect more than once, you can now
|
91
|
+
pass the `reconnect_attempts` option (#347)
|
92
|
+
|
93
|
+
# 3.0.7
|
94
|
+
|
95
|
+
* Added method `Redis#dup` to duplicate a Redis connection.
|
96
|
+
|
97
|
+
* IPv6 support.
|
98
|
+
|
99
|
+
# 3.0.6
|
100
|
+
|
101
|
+
* Added support for `SCAN` and variants.
|
102
|
+
|
103
|
+
# 3.0.5
|
104
|
+
|
105
|
+
* Fix calling #select from a pipeline (#309).
|
106
|
+
|
107
|
+
* Added method `Redis#connected?`.
|
108
|
+
|
109
|
+
* Added support for `MIGRATE` (Redis 2.6).
|
110
|
+
|
111
|
+
* Support extended SET command (#343, thanks to @benubois).
|
112
|
+
|
113
|
+
# 3.0.4
|
114
|
+
|
115
|
+
* Ensure #watch without a block returns "OK" (#332).
|
116
|
+
|
117
|
+
* Make futures identifiable (#330).
|
118
|
+
|
119
|
+
* Fix an issue preventing STORE in a SORT with multiple GETs (#328).
|
120
|
+
|
121
|
+
# 3.0.3
|
122
|
+
|
123
|
+
* Blocking list commands (`BLPOP`, `BRPOP`, `BRPOPLPUSH`) use a socket
|
124
|
+
timeout equal to the sum of the command's timeout and the Redis
|
125
|
+
client's timeout, instead of disabling socket timeout altogether.
|
126
|
+
|
127
|
+
* Ruby 2.0 compatibility.
|
128
|
+
|
129
|
+
* Added support for `DUMP` and `RESTORE` (Redis 2.6).
|
130
|
+
|
131
|
+
* Added support for `BITCOUNT` and `BITOP` (Redis 2.6).
|
132
|
+
|
133
|
+
* Call `#to_s` on value argument for `SET`, `SETEX`, `PSETEX`, `GETSET`,
|
134
|
+
`SETNX`, and `SETRANGE`.
|
135
|
+
|
136
|
+
# 3.0.2
|
137
|
+
|
138
|
+
* Unescape CGI escaped password in URL.
|
139
|
+
|
140
|
+
* Fix test to check availability of `UNIXSocket`.
|
141
|
+
|
142
|
+
* Fix handling of score = +/- infinity for sorted set commands.
|
143
|
+
|
144
|
+
* Replace array splats with concatenation where possible.
|
145
|
+
|
146
|
+
* Raise if `EXEC` returns an error.
|
147
|
+
|
148
|
+
* Passing a nil value in options hash no longer overwrites the default.
|
149
|
+
|
150
|
+
* Allow string keys in options hash passed to `Redis.new` or
|
151
|
+
`Redis.connect`.
|
152
|
+
|
153
|
+
* Fix uncaught error triggering unrelated error (synchrony driver).
|
154
|
+
|
155
|
+
See f7ffd5f1a628029691084de69e5b46699bb8b96d and #248.
|
156
|
+
|
157
|
+
# 3.0.1
|
158
|
+
|
159
|
+
* Fix reconnect logic not kicking in on a write error.
|
160
|
+
|
161
|
+
See 427dbd52928af452f35aa0a57b621bee56cdcb18 and #238.
|
162
|
+
|
163
|
+
# 3.0.0
|
164
|
+
|
165
|
+
### Upgrading from 2.x to 3.0
|
166
|
+
|
167
|
+
The following items are the most important changes to review when
|
168
|
+
upgrading from redis-rb 2.x. A full list of changes can be found below.
|
169
|
+
|
170
|
+
* The methods for the following commands have changed the arguments they
|
171
|
+
take, their return value, or both.
|
172
|
+
|
173
|
+
* `BLPOP`, `BRPOP`, `BRPOPLPUSH`
|
174
|
+
* `SORT`
|
175
|
+
* `MSETNX`
|
176
|
+
* `ZRANGE`, `ZREVRANGE`, `ZRANGEBYSCORE`, `ZREVRANGEBYSCORE`
|
177
|
+
* `ZINCRBY`, `ZSCORE`
|
178
|
+
|
179
|
+
* The return value from `#pipelined` and `#multi` no longer contains
|
180
|
+
unprocessed replies, but the same replies that would be returned if
|
181
|
+
the command had not been executed in these blocks.
|
182
|
+
|
183
|
+
* The client raises custom errors on connection errors, instead of
|
184
|
+
`RuntimeError` and errors in the `Errno` family.
|
185
|
+
|
186
|
+
### Changes
|
187
|
+
|
188
|
+
* Added support for scripting commands (Redis 2.6).
|
189
|
+
|
190
|
+
Scripts can be executed using `#eval` and `#evalsha`. Both can
|
191
|
+
commands can either take two arrays to specify `KEYS` and `ARGV`, or
|
192
|
+
take a hash containing `:keys` and `:argv` to specify `KEYS` and
|
193
|
+
`ARGV`.
|
194
|
+
|
195
|
+
```ruby
|
196
|
+
redis.eval("return ARGV[1] * ARGV[2]", :argv => [2, 3])
|
197
|
+
# => 6
|
198
|
+
```
|
199
|
+
|
200
|
+
Subcommands of the `SCRIPT` command can be executed via the
|
201
|
+
`#script` method.
|
202
|
+
|
203
|
+
For example:
|
204
|
+
|
205
|
+
```ruby
|
206
|
+
redis.script(:load, "return ARGV[1] * ARGV[2]")
|
207
|
+
# => "58db5d365a1922f32e7aa717722141ea9c2b0cf3"
|
208
|
+
redis.script(:exists, "58db5d365a1922f32e7aa717722141ea9c2b0cf3")
|
209
|
+
# => true
|
210
|
+
redis.script(:flush)
|
211
|
+
# => "OK"
|
212
|
+
```
|
213
|
+
|
214
|
+
* The repository now lives at [https://github.com/redis/redis-rb](https://github.com/redis/redis-rb).
|
215
|
+
Thanks, Ezra!
|
216
|
+
|
217
|
+
* Added support for `PEXPIRE`, `PEXPIREAT`, `PTTL`, `PSETEX`,
|
218
|
+
`INCRYBYFLOAT`, `HINCRYBYFLOAT` and `TIME` (Redis 2.6).
|
219
|
+
|
220
|
+
* `Redis.current` is now thread unsafe, because the client itself is thread safe.
|
221
|
+
|
222
|
+
In the future you'll be able to do something like:
|
223
|
+
|
224
|
+
```ruby
|
225
|
+
Redis.current = Redis::Pool.connect
|
226
|
+
```
|
227
|
+
|
228
|
+
This makes `Redis.current` actually usable in multi-threaded environments,
|
229
|
+
while not affecting those running a single thread.
|
230
|
+
|
231
|
+
* Change API for `BLPOP`, `BRPOP` and `BRPOPLPUSH`.
|
232
|
+
|
233
|
+
Both `BLPOP` and `BRPOP` now take a single argument equal to a
|
234
|
+
string key, or an array with string keys, followed by an optional
|
235
|
+
hash with a `:timeout` key. When not specified, the timeout defaults
|
236
|
+
to `0` to not time out.
|
237
|
+
|
238
|
+
```ruby
|
239
|
+
redis.blpop(["list1", "list2"], :timeout => 1.0)
|
240
|
+
```
|
241
|
+
|
242
|
+
`BRPOPLPUSH` also takes an optional hash with a `:timeout` key as
|
243
|
+
last argument for consistency. When not specified, the timeout
|
244
|
+
defaults to `0` to not time out.
|
245
|
+
|
246
|
+
```ruby
|
247
|
+
redis.brpoplpush("some_list", "another_list", :timeout => 1.0)
|
248
|
+
```
|
249
|
+
|
250
|
+
* When `SORT` is passed multiple key patterns to get via the `:get`
|
251
|
+
option, it now returns an array per result element, holding all `GET`
|
252
|
+
substitutions.
|
253
|
+
|
254
|
+
* The `MSETNX` command now returns a boolean.
|
255
|
+
|
256
|
+
* The `ZRANGE`, `ZREVRANGE`, `ZRANGEBYSCORE` and `ZREVRANGEBYSCORE` commands
|
257
|
+
now return an array containing `[String, Float]` pairs when
|
258
|
+
`:with_scores => true` is passed.
|
259
|
+
|
260
|
+
For example:
|
261
|
+
|
262
|
+
```ruby
|
263
|
+
redis.zrange("zset", 0, -1, :with_scores => true)
|
264
|
+
# => [["foo", 1.0], ["bar", 2.0]]
|
265
|
+
```
|
266
|
+
|
267
|
+
* The `ZINCRBY` and `ZSCORE` commands now return a `Float` score instead
|
268
|
+
of a string holding a representation of the score.
|
269
|
+
|
270
|
+
* The client now raises custom exceptions where it makes sense.
|
271
|
+
|
272
|
+
If by any chance you were rescuing low-level exceptions (`Errno::*`),
|
273
|
+
you should now rescue as follows:
|
274
|
+
|
275
|
+
Errno::ECONNRESET -> Redis::ConnectionError
|
276
|
+
Errno::EPIPE -> Redis::ConnectionError
|
277
|
+
Errno::ECONNABORTED -> Redis::ConnectionError
|
278
|
+
Errno::EBADF -> Redis::ConnectionError
|
279
|
+
Errno::EINVAL -> Redis::ConnectionError
|
280
|
+
Errno::EAGAIN -> Redis::TimeoutError
|
281
|
+
Errno::ECONNREFUSED -> Redis::CannotConnectError
|
282
|
+
|
283
|
+
* Always raise exceptions originating from erroneous command invocation
|
284
|
+
inside pipelines and MULTI/EXEC blocks.
|
285
|
+
|
286
|
+
The old behavior (swallowing exceptions) could cause application bugs
|
287
|
+
to go unnoticed.
|
288
|
+
|
289
|
+
* Implement futures for assigning values inside pipelines and MULTI/EXEC
|
290
|
+
blocks. Futures are assigned their value after the pipeline or
|
291
|
+
MULTI/EXEC block has executed.
|
292
|
+
|
293
|
+
```ruby
|
294
|
+
$redis.pipelined do
|
295
|
+
@future = $redis.get "key"
|
296
|
+
end
|
297
|
+
|
298
|
+
puts @future.value
|
299
|
+
```
|
300
|
+
|
301
|
+
* Ruby 1.8.6 is officially not supported.
|
302
|
+
|
303
|
+
* Support `ZCOUNT` in `Redis::Distributed` (Michael Dungan).
|
304
|
+
|
305
|
+
* Pipelined commands now return the same replies as when called outside
|
306
|
+
a pipeline.
|
307
|
+
|
308
|
+
In the past, pipelined replies were returned without post-processing.
|
309
|
+
|
310
|
+
* Support `SLOWLOG` command (Michael Bernstein).
|
311
|
+
|
312
|
+
* Calling `SHUTDOWN` effectively disconnects the client (Stefan Kaes).
|
313
|
+
|
314
|
+
* Basic support for mapping commands so that they can be renamed on the
|
315
|
+
server.
|
316
|
+
|
317
|
+
* Connecting using a URL now checks that a host is given.
|
318
|
+
|
319
|
+
It's just a small sanity check, cf. #126
|
320
|
+
|
321
|
+
* Support variadic commands introduced in Redis 2.4.
|
322
|
+
|
323
|
+
# 2.2.2
|
324
|
+
|
325
|
+
* Added method `Redis::Distributed#hsetnx`.
|
326
|
+
|
327
|
+
# 2.2.1
|
328
|
+
|
329
|
+
* Internal API: Client#call and family are now called with a single array
|
330
|
+
argument, since splatting a large number of arguments (100K+) results in a
|
331
|
+
stack overflow on 1.9.2.
|
332
|
+
|
333
|
+
* The `INFO` command can optionally take a subcommand. When the subcommand is
|
334
|
+
`COMMANDSTATS`, the client will properly format the returned statistics per
|
335
|
+
command. Subcommands for `INFO` are available since Redis v2.3.0 (unstable).
|
336
|
+
|
337
|
+
* Change `IO#syswrite` back to the buffered `IO#write` since some Rubies do
|
338
|
+
short writes for large (1MB+) buffers and some don't (see issue #108).
|
339
|
+
|
340
|
+
# 2.2.0
|
341
|
+
|
342
|
+
* Added method `Redis#without_reconnect` that ensures the client will not try
|
343
|
+
to reconnect when running the code inside the specified block.
|
344
|
+
|
345
|
+
* Thread-safe by default. Thread safety can be explicitly disabled by passing
|
346
|
+
`:thread_safe => false` as argument.
|
347
|
+
|
348
|
+
* Commands called inside a MULTI/EXEC no longer raise error replies, since a
|
349
|
+
successful EXEC means the commands inside the block were executed.
|
350
|
+
|
351
|
+
* MULTI/EXEC blocks are pipelined.
|
352
|
+
|
353
|
+
* Don't disconnect on error replies.
|
354
|
+
|
355
|
+
* Use `IO#syswrite` instead of `IO#write` because write buffering is not
|
356
|
+
necessary.
|
357
|
+
|
358
|
+
* Connect to a unix socket by passing the `:path` option as argument.
|
359
|
+
|
360
|
+
* The timeout value is coerced into a float, allowing sub-second timeouts.
|
361
|
+
|
362
|
+
* Accept both `:with_scores` _and_ `:withscores` as argument to sorted set
|
363
|
+
commands.
|
364
|
+
|
365
|
+
* Use [hiredis](https://github.com/pietern/hiredis-rb) (v0.3 or higher) by
|
366
|
+
requiring "redis/connection/hiredis".
|
367
|
+
|
368
|
+
* Use [em-synchrony](https://github.com/igrigorik/em-synchrony) by requiring
|
369
|
+
"redis/connection/synchrony".
|
370
|
+
|
371
|
+
# 2.1.1
|
372
|
+
|
373
|
+
See commit log.
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Ezra Zygmuntowicz
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|