redis 3.3.5 → 4.0.0.rc1
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/.travis.yml +32 -50
- data/CHANGELOG.md +7 -9
- data/Gemfile +0 -1
- data/README.md +31 -75
- data/benchmarking/logging.rb +1 -1
- data/lib/redis.rb +31 -35
- data/lib/redis/client.rb +13 -8
- data/lib/redis/connection.rb +2 -2
- data/lib/redis/connection/command_helper.rb +2 -8
- data/lib/redis/connection/hiredis.rb +2 -2
- data/lib/redis/connection/ruby.rb +7 -27
- data/lib/redis/connection/synchrony.rb +3 -3
- data/lib/redis/pipeline.rb +0 -6
- data/lib/redis/version.rb +1 -1
- data/makefile +42 -0
- data/redis.gemspec +4 -8
- data/test/bitpos_test.rb +13 -19
- data/test/blocking_commands_test.rb +147 -6
- data/test/client_test.rb +1 -1
- data/test/command_map_test.rb +3 -5
- data/test/commands_on_hashes_test.rb +158 -5
- data/test/commands_on_hyper_log_log_test.rb +55 -6
- data/test/commands_on_lists_test.rb +139 -5
- data/test/commands_on_sets_test.rb +136 -5
- data/test/commands_on_sorted_sets_test.rb +312 -5
- data/test/commands_on_strings_test.rb +243 -6
- data/test/commands_on_value_types_test.rb +120 -7
- data/test/connection_handling_test.rb +5 -7
- data/test/encoding_test.rb +4 -8
- data/test/error_replies_test.rb +2 -4
- data/test/fork_safety_test.rb +1 -6
- data/test/helper.rb +9 -62
- data/test/helper_test.rb +1 -3
- data/test/internals_test.rb +67 -49
- data/test/persistence_control_commands_test.rb +1 -3
- data/test/pipelining_commands_test.rb +4 -8
- data/test/publish_subscribe_test.rb +1 -3
- data/test/remote_server_control_commands_test.rb +61 -4
- data/test/scanning_test.rb +1 -7
- data/test/scripting_test.rb +1 -3
- data/test/sentinel_command_test.rb +1 -3
- data/test/sentinel_test.rb +1 -3
- data/test/sorting_test.rb +1 -3
- data/test/ssl_test.rb +45 -49
- data/test/support/connection/hiredis.rb +1 -1
- data/test/support/connection/ruby.rb +1 -1
- data/test/support/connection/synchrony.rb +1 -1
- data/test/synchrony_driver.rb +6 -9
- data/test/thread_safety_test.rb +1 -3
- data/test/transactions_test.rb +1 -3
- data/test/unknown_commands_test.rb +1 -3
- data/test/url_param_test.rb +44 -46
- metadata +31 -77
- data/Rakefile +0 -87
- data/examples/dist_redis.rb +0 -43
- data/lib/redis/distributed.rb +0 -873
- data/lib/redis/hash_ring.rb +0 -132
- data/test/connection_test.rb +0 -57
- data/test/distributed_blocking_commands_test.rb +0 -46
- data/test/distributed_commands_on_hashes_test.rb +0 -10
- data/test/distributed_commands_on_hyper_log_log_test.rb +0 -33
- data/test/distributed_commands_on_lists_test.rb +0 -22
- data/test/distributed_commands_on_sets_test.rb +0 -83
- data/test/distributed_commands_on_sorted_sets_test.rb +0 -18
- data/test/distributed_commands_on_strings_test.rb +0 -59
- data/test/distributed_commands_on_value_types_test.rb +0 -95
- data/test/distributed_commands_requiring_clustering_test.rb +0 -164
- data/test/distributed_connection_handling_test.rb +0 -23
- data/test/distributed_internals_test.rb +0 -79
- data/test/distributed_key_tags_test.rb +0 -52
- data/test/distributed_persistence_control_commands_test.rb +0 -26
- data/test/distributed_publish_subscribe_test.rb +0 -92
- data/test/distributed_remote_server_control_commands_test.rb +0 -66
- data/test/distributed_scripting_test.rb +0 -102
- data/test/distributed_sorting_test.rb +0 -20
- data/test/distributed_test.rb +0 -58
- data/test/distributed_transactions_test.rb +0 -32
- data/test/lint/blocking_commands.rb +0 -150
- data/test/lint/hashes.rb +0 -162
- data/test/lint/hyper_log_log.rb +0 -60
- data/test/lint/lists.rb +0 -143
- data/test/lint/sets.rb +0 -140
- data/test/lint/sorted_sets.rb +0 -316
- data/test/lint/strings.rb +0 -260
- data/test/lint/value_types.rb +0 -122
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d72ccd62dcdffae216b836b1e3655bf7f632e4e9
|
4
|
+
data.tar.gz: 0cf0966047ed05199088049df15d2ec01bbcd412
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7196307b6ae34d4a23001617acae003c7fc71ccfea7d7f5900bb19dc2a22d5f83292859fb793945b0274b6750f0f31a98397fc2666bf5507eb00313f0efcdbf
|
7
|
+
data.tar.gz: c20a6e85b2e3b3ccbbeeec274e134be97597fccd45e3798a9c7d687df0ff150588b05b441eb34b465d22c43b972e76498e31f2e8c03534b76a9a1dcbff024781
|
data/.travis.yml
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
language: ruby
|
2
2
|
|
3
|
+
script: make test
|
4
|
+
|
5
|
+
before_install:
|
6
|
+
- rvm get stable
|
7
|
+
|
3
8
|
rvm:
|
4
|
-
- 1.8.7
|
5
|
-
- 1.9.3
|
6
|
-
- 2.0
|
7
9
|
- 2.1
|
8
10
|
- 2.2
|
9
|
-
- 2.3
|
10
|
-
- jruby-
|
11
|
-
-
|
12
|
-
- jruby-9.0.5.0
|
13
|
-
- rbx-2
|
11
|
+
- 2.3
|
12
|
+
- jruby-9
|
13
|
+
- rbx-3
|
14
14
|
|
15
15
|
gemfile: ".travis/Gemfile"
|
16
16
|
|
@@ -21,13 +21,13 @@ env:
|
|
21
21
|
- VERBOSE=true
|
22
22
|
- TIMEOUT=1
|
23
23
|
matrix:
|
24
|
-
-
|
25
|
-
-
|
26
|
-
-
|
27
|
-
-
|
28
|
-
-
|
29
|
-
-
|
30
|
-
-
|
24
|
+
- DRIVER=ruby REDIS_BRANCH=3.0
|
25
|
+
- DRIVER=ruby REDIS_BRANCH=3.2
|
26
|
+
- DRIVER=hiredis REDIS_BRANCH=3.0
|
27
|
+
- DRIVER=hiredis REDIS_BRANCH=3.2
|
28
|
+
- DRIVER=synchrony REDIS_BRANCH=3.0
|
29
|
+
- DRIVER=synchrony REDIS_BRANCH=3.2
|
30
|
+
- DRIVER=ruby REDIS_BRANCH=unstable
|
31
31
|
|
32
32
|
branches:
|
33
33
|
only:
|
@@ -36,52 +36,34 @@ branches:
|
|
36
36
|
matrix:
|
37
37
|
exclude:
|
38
38
|
# hiredis
|
39
|
-
- rvm: jruby-
|
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
|
39
|
+
- rvm: jruby-9
|
46
40
|
gemfile: .travis/Gemfile
|
47
|
-
env:
|
48
|
-
- rvm: jruby-
|
41
|
+
env: DRIVER=hiredis REDIS_BRANCH=3.0
|
42
|
+
- rvm: jruby-9
|
49
43
|
gemfile: .travis/Gemfile
|
50
|
-
env:
|
51
|
-
- rvm: jruby-9
|
44
|
+
env: DRIVER=hiredis REDIS_BRANCH=3.2
|
45
|
+
- rvm: jruby-9
|
52
46
|
gemfile: .travis/Gemfile
|
53
|
-
env:
|
54
|
-
- rvm: jruby-9
|
47
|
+
env: DRIVER=hiredis REDIS_BRANCH=3.0
|
48
|
+
- rvm: jruby-9
|
55
49
|
gemfile: .travis/Gemfile
|
56
|
-
env:
|
50
|
+
env: DRIVER=hiredis REDIS_BRANCH=3.2
|
57
51
|
|
58
52
|
# synchrony
|
59
|
-
- rvm:
|
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
|
53
|
+
- rvm: jruby-9
|
72
54
|
gemfile: .travis/Gemfile
|
73
|
-
env:
|
74
|
-
- rvm: jruby-
|
55
|
+
env: DRIVER=synchrony REDIS_BRANCH=3.0
|
56
|
+
- rvm: jruby-9
|
75
57
|
gemfile: .travis/Gemfile
|
76
|
-
env:
|
77
|
-
- rvm: jruby-9
|
58
|
+
env: DRIVER=synchrony REDIS_BRANCH=3.2
|
59
|
+
- rvm: jruby-9
|
78
60
|
gemfile: .travis/Gemfile
|
79
|
-
env:
|
80
|
-
- rvm: jruby-9
|
61
|
+
env: DRIVER=synchrony REDIS_BRANCH=3.0
|
62
|
+
- rvm: jruby-9
|
81
63
|
gemfile: .travis/Gemfile
|
82
|
-
env:
|
64
|
+
env: DRIVER=synchrony REDIS_BRANCH=3.2
|
83
65
|
allow_failures:
|
84
|
-
- rvm: rbx-
|
66
|
+
- rvm: rbx-3
|
85
67
|
|
86
68
|
notifications:
|
87
69
|
irc:
|
data/CHANGELOG.md
CHANGED
@@ -1,19 +1,17 @@
|
|
1
|
-
#
|
1
|
+
# 4.0 (unreleased)
|
2
2
|
|
3
|
-
*
|
3
|
+
* Removed `Redis.connect`. Use `Redis.new`.
|
4
4
|
|
5
|
-
#
|
5
|
+
* Removed `Redis#[]` and `Redis#[]=` aliases.
|
6
6
|
|
7
|
-
* `Redis
|
8
|
-
You shouldn't need to call `Redis#_client`, ever.
|
7
|
+
* Removed `Redis::Distributed`.
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
* Improved timeout handling after dropping Timeout module.
|
9
|
+
* Added support for `CLIENT` commands. The lower-level client can be
|
10
|
+
accessed via `Redis#_client`.
|
13
11
|
|
14
12
|
# 3.3.2
|
15
13
|
|
16
|
-
* Added support for SPOP with COUNT. See #628.
|
14
|
+
* Added support for `SPOP` with COUNT. See #628.
|
17
15
|
|
18
16
|
* Fixed connection glitches when using SSL. See #644.
|
19
17
|
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,46 +1,17 @@
|
|
1
1
|
# redis-rb [![Build Status][travis-image]][travis-link] [![Inline docs][inchpages-image]][inchpages-link]
|
2
2
|
|
3
|
-
[
|
4
|
-
|
5
|
-
[travis-home]: http://travis-ci.org/
|
6
|
-
[inchpages-image]: http://inch-ci.org/github/redis/redis-rb.png
|
7
|
-
[inchpages-link]: http://inch-ci.org/github/redis/redis-rb
|
3
|
+
A Ruby client that tries to match [Redis][redis-home]' API one-to-one, while still
|
4
|
+
providing an idiomatic interface.
|
8
5
|
|
9
|
-
A Ruby client library for [Redis][redis-home].
|
10
|
-
|
11
|
-
[redis-home]: http://redis.io
|
12
|
-
|
13
|
-
A Ruby client that tries to match Redis' API one-to-one, while still
|
14
|
-
providing an idiomatic interface. It features thread-safety, client-side
|
15
|
-
sharding, pipelining, and an obsession for performance.
|
16
|
-
|
17
|
-
## Upgrading from 2.x to 3.0
|
18
|
-
|
19
|
-
Please refer to the [CHANGELOG][changelog-3.0.0] for a summary of the
|
20
|
-
most important changes, as well as a full list of changes.
|
21
|
-
|
22
|
-
[changelog-3.0.0]: https://github.com/redis/redis-rb/blob/master/CHANGELOG.md#300
|
23
6
|
|
24
7
|
## Getting started
|
25
8
|
|
26
|
-
|
27
|
-
|
28
|
-
```
|
29
|
-
gem install redis
|
30
|
-
```
|
31
|
-
|
32
|
-
Or if you are using **bundler**, add
|
9
|
+
Install with:
|
33
10
|
|
34
11
|
```
|
35
|
-
|
12
|
+
$ gem install redis
|
36
13
|
```
|
37
14
|
|
38
|
-
to your `Gemfile`, and run `bundle install`
|
39
|
-
|
40
|
-
As of version 2.0 this client only targets Redis version 2.0 and higher.
|
41
|
-
You can use an older version of this client if you need to interface
|
42
|
-
with a Redis instance older than 2.0, but this is no longer supported.
|
43
|
-
|
44
15
|
You can connect to Redis by instantiating the `Redis` class:
|
45
16
|
|
46
17
|
```ruby
|
@@ -54,17 +25,15 @@ listening on `localhost`, port 6379. If you need to connect to a remote
|
|
54
25
|
server or a different port, try:
|
55
26
|
|
56
27
|
```ruby
|
57
|
-
redis = Redis.new(:
|
28
|
+
redis = Redis.new(host: "10.0.1.1", port: 6380, db: 15)
|
58
29
|
```
|
59
30
|
|
60
31
|
You can also specify connection options as a [`redis://` URL][redis-url]:
|
61
32
|
|
62
33
|
```ruby
|
63
|
-
redis = Redis.new(:
|
34
|
+
redis = Redis.new(url: "redis://:p4ssw0rd@10.0.1.1:6380/15")
|
64
35
|
```
|
65
36
|
|
66
|
-
[redis-url]: http://www.iana.org/assignments/uri-schemes/prov/redis
|
67
|
-
|
68
37
|
By default, the client will try to read the `REDIS_URL` environment variable
|
69
38
|
and use that as URL to connect to. The above statement is therefore equivalent
|
70
39
|
to setting this environment variable and calling `Redis.new` without arguments.
|
@@ -72,13 +41,13 @@ to setting this environment variable and calling `Redis.new` without arguments.
|
|
72
41
|
To connect to Redis listening on a Unix socket, try:
|
73
42
|
|
74
43
|
```ruby
|
75
|
-
redis = Redis.new(:
|
44
|
+
redis = Redis.new(path: "/tmp/redis.sock")
|
76
45
|
```
|
77
46
|
|
78
47
|
To connect to a password protected Redis instance, use:
|
79
48
|
|
80
49
|
```ruby
|
81
|
-
redis = Redis.new(:
|
50
|
+
redis = Redis.new(password: "mysecret")
|
82
51
|
```
|
83
52
|
|
84
53
|
The Redis class exports methods that are named identical to the commands
|
@@ -86,8 +55,6 @@ they execute. The arguments these methods accept are often identical to
|
|
86
55
|
the arguments specified on the [Redis website][redis-commands]. For
|
87
56
|
instance, the `SET` and `GET` commands can be called like this:
|
88
57
|
|
89
|
-
[redis-commands]: http://redis.io/commands
|
90
|
-
|
91
58
|
```ruby
|
92
59
|
redis.set("mykey", "hello world")
|
93
60
|
# => "OK"
|
@@ -96,24 +63,22 @@ redis.get("mykey")
|
|
96
63
|
# => "hello world"
|
97
64
|
```
|
98
65
|
|
99
|
-
All commands, their arguments and return values are documented
|
100
|
-
available on [
|
101
|
-
|
102
|
-
[rdoc]: http://rdoc.info/github/redis/redis-rb/
|
66
|
+
All commands, their arguments, and return values are documented and
|
67
|
+
available on [RubyDoc.info][rubydoc].
|
103
68
|
|
104
69
|
## Sentinel support
|
105
70
|
|
106
|
-
The client is able to perform automatic
|
71
|
+
The client is able to perform automatic failover by using [Redis
|
107
72
|
Sentinel](http://redis.io/topics/sentinel). Make sure to run Redis 2.8+
|
108
73
|
if you want to use this feature.
|
109
74
|
|
110
75
|
To connect using Sentinel, use:
|
111
76
|
|
112
77
|
```ruby
|
113
|
-
SENTINELS = [{:
|
114
|
-
{:
|
78
|
+
SENTINELS = [{ host: "127.0.0.1", port: 26380 },
|
79
|
+
{ host: "127.0.0.1", port: 26381 }]
|
115
80
|
|
116
|
-
redis = Redis.new(:
|
81
|
+
redis = Redis.new(url: "redis://mymaster", sentinels: SENTINELS, role: :master)
|
117
82
|
```
|
118
83
|
|
119
84
|
* The master name identifies a group of Redis instances composed of a master
|
@@ -374,37 +339,28 @@ redis = Redis.new(:driver => :synchrony)
|
|
374
339
|
|
375
340
|
## Testing
|
376
341
|
|
377
|
-
This library is tested
|
378
|
-
|
379
|
-
|
380
|
-
* MRI 1.8.7 (drivers: ruby, hiredis)
|
381
|
-
* MRI 1.9.3 (drivers: ruby, hiredis, synchrony)
|
382
|
-
* MRI 2.0 (drivers: ruby, hiredis, synchrony)
|
383
|
-
* MRI 2.1 (drivers: ruby, hiredis, synchrony)
|
384
|
-
* MRI 2.2 (drivers: ruby, hiredis, synchrony)
|
385
|
-
* MRI 2.3 (drivers: ruby, hiredis, synchrony)
|
386
|
-
* JRuby 1.7 (1.8 mode) (drivers: ruby)
|
387
|
-
* JRuby 1.7 (1.9 mode) (drivers: ruby)
|
342
|
+
This library is tested against recent Ruby and Redis versions.
|
343
|
+
Check [Travis][travis-link] for the exact versions supported.
|
388
344
|
|
389
345
|
## Contributors
|
390
346
|
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
* Taylor Weibley
|
396
|
-
* Matthew Clark
|
397
|
-
* Brian McKinney
|
398
|
-
* Luca Guidi
|
399
|
-
* Salvatore Sanfilippo
|
400
|
-
* Chris Wanstrath
|
401
|
-
* Damian Janowski
|
402
|
-
* Michel Martens
|
403
|
-
* Nick Quaranto
|
404
|
-
* Pieter Noordhuis
|
405
|
-
* Ilya Grigorik
|
347
|
+
Several people contributed to redis-rb, but we would like to especially
|
348
|
+
mention Ezra Zygmuntowicz. Ezra introduced the Ruby community to many
|
349
|
+
new cool technologies, like Redis. He wrote the first version of this
|
350
|
+
client and evangelized Redis in Rubyland. Thank you, Ezra.
|
406
351
|
|
407
352
|
## Contributing
|
408
353
|
|
409
354
|
[Fork the project](https://github.com/redis/redis-rb) and send pull
|
410
355
|
requests. You can also ask for help at `#redis-rb` on Freenode.
|
356
|
+
|
357
|
+
|
358
|
+
[inchpages-image]: https://inch-ci.org/github/redis/redis-rb.png
|
359
|
+
[inchpages-link]: https://inch-ci.org/github/redis/redis-rb
|
360
|
+
[redis-commands]: http://redis.io/commands
|
361
|
+
[redis-home]: http://redis.io
|
362
|
+
[redis-url]: http://www.iana.org/assignments/uri-schemes/prov/redis
|
363
|
+
[travis-home]: https://travis-ci.org/
|
364
|
+
[travis-image]: https://secure.travis-ci.org/redis/redis-rb.png?branch=master
|
365
|
+
[travis-link]: https://travis-ci.org/redis/redis-rb
|
366
|
+
[rubydoc]: http://www.rubydoc.info/gems/redis
|
data/benchmarking/logging.rb
CHANGED
data/lib/redis.rb
CHANGED
@@ -1,21 +1,8 @@
|
|
1
1
|
require "monitor"
|
2
|
-
|
2
|
+
require_relative "redis/errors"
|
3
3
|
|
4
4
|
class Redis
|
5
5
|
|
6
|
-
def self.deprecate(message, trace = caller[0])
|
7
|
-
$stderr.puts "\n#{message} (in #{trace})"
|
8
|
-
end
|
9
|
-
|
10
|
-
attr :client
|
11
|
-
|
12
|
-
# @deprecated The preferred way to create a new client object is using `#new`.
|
13
|
-
# This method does not actually establish a connection to Redis,
|
14
|
-
# in contrary to what you might expect.
|
15
|
-
def self.connect(options = {})
|
16
|
-
new(options)
|
17
|
-
end
|
18
|
-
|
19
6
|
def self.current
|
20
7
|
@current ||= Redis.new
|
21
8
|
end
|
@@ -119,6 +106,10 @@ class Redis
|
|
119
106
|
end
|
120
107
|
end
|
121
108
|
|
109
|
+
def _client
|
110
|
+
@client
|
111
|
+
end
|
112
|
+
|
122
113
|
# Authenticate to the server.
|
123
114
|
#
|
124
115
|
# @param [String] password must match the password specified in the
|
@@ -209,6 +200,25 @@ class Redis
|
|
209
200
|
end
|
210
201
|
end
|
211
202
|
|
203
|
+
# Manage client connections.
|
204
|
+
#
|
205
|
+
# @param [String, Symbol] subcommand e.g. `kill`, `list`, `getname`, `setname`
|
206
|
+
# @return [String, Hash] depends on subcommand
|
207
|
+
def client(subcommand = nil, *args)
|
208
|
+
synchronize do |client|
|
209
|
+
client.call([:client, subcommand] + args) do |reply|
|
210
|
+
if subcommand.to_s == "list"
|
211
|
+
reply.lines.map do |line|
|
212
|
+
entries = line.chomp.split(/[ =]/)
|
213
|
+
Hash[entries.each_slice(2).to_a]
|
214
|
+
end
|
215
|
+
else
|
216
|
+
reply
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
212
222
|
# Return the number of keys in the selected database.
|
213
223
|
#
|
214
224
|
# @return [Fixnum]
|
@@ -477,8 +487,8 @@ class Redis
|
|
477
487
|
def migrate(key, options)
|
478
488
|
host = options[:host] || raise(RuntimeError, ":host not specified")
|
479
489
|
port = options[:port] || raise(RuntimeError, ":port not specified")
|
480
|
-
db = (options[:db] || client.db).to_i
|
481
|
-
timeout = (options[:timeout] || client.timeout).to_i
|
490
|
+
db = (options[:db] || @client.db).to_i
|
491
|
+
timeout = (options[:timeout] || @client.timeout).to_i
|
482
492
|
|
483
493
|
synchronize do |client|
|
484
494
|
client.call([:migrate, host, port, key, db, timeout])
|
@@ -756,8 +766,6 @@ class Redis
|
|
756
766
|
end
|
757
767
|
end
|
758
768
|
|
759
|
-
alias :[]= :set
|
760
|
-
|
761
769
|
# Set the time to live in seconds of a key.
|
762
770
|
#
|
763
771
|
# @param [String] key
|
@@ -863,8 +871,6 @@ class Redis
|
|
863
871
|
end
|
864
872
|
end
|
865
873
|
|
866
|
-
alias :[] :get
|
867
|
-
|
868
874
|
# Get the values of all the given keys.
|
869
875
|
#
|
870
876
|
# @example
|
@@ -2700,16 +2706,6 @@ class Redis
|
|
2700
2706
|
self.class.new(@options)
|
2701
2707
|
end
|
2702
2708
|
|
2703
|
-
def connection
|
2704
|
-
{
|
2705
|
-
:host => @original_client.host,
|
2706
|
-
:port => @original_client.port,
|
2707
|
-
:db => @original_client.db,
|
2708
|
-
:id => @original_client.id,
|
2709
|
-
:location => @original_client.location
|
2710
|
-
}
|
2711
|
-
end
|
2712
|
-
|
2713
2709
|
def method_missing(command, *args)
|
2714
2710
|
synchronize do |client|
|
2715
2711
|
client.call([command] + args)
|
@@ -2781,8 +2777,8 @@ private
|
|
2781
2777
|
|
2782
2778
|
end
|
2783
2779
|
|
2784
|
-
|
2785
|
-
|
2786
|
-
|
2787
|
-
|
2788
|
-
|
2780
|
+
require_relative "redis/version"
|
2781
|
+
require_relative "redis/connection"
|
2782
|
+
require_relative "redis/client"
|
2783
|
+
require_relative "redis/pipeline"
|
2784
|
+
require_relative "redis/subscribe"
|