redis 3.0.0 → 4.5.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.
Files changed (106) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +315 -0
  3. data/README.md +301 -58
  4. data/lib/redis/client.rb +383 -88
  5. data/lib/redis/cluster/command.rb +81 -0
  6. data/lib/redis/cluster/command_loader.rb +33 -0
  7. data/lib/redis/cluster/key_slot_converter.rb +72 -0
  8. data/lib/redis/cluster/node.rb +108 -0
  9. data/lib/redis/cluster/node_key.rb +31 -0
  10. data/lib/redis/cluster/node_loader.rb +37 -0
  11. data/lib/redis/cluster/option.rb +93 -0
  12. data/lib/redis/cluster/slot.rb +86 -0
  13. data/lib/redis/cluster/slot_loader.rb +49 -0
  14. data/lib/redis/cluster.rb +291 -0
  15. data/lib/redis/connection/command_helper.rb +7 -10
  16. data/lib/redis/connection/hiredis.rb +12 -8
  17. data/lib/redis/connection/registry.rb +2 -1
  18. data/lib/redis/connection/ruby.rb +266 -74
  19. data/lib/redis/connection/synchrony.rb +41 -14
  20. data/lib/redis/connection.rb +4 -2
  21. data/lib/redis/distributed.rb +258 -76
  22. data/lib/redis/errors.rb +48 -0
  23. data/lib/redis/hash_ring.rb +31 -73
  24. data/lib/redis/pipeline.rb +74 -18
  25. data/lib/redis/subscribe.rb +24 -13
  26. data/lib/redis/version.rb +3 -1
  27. data/lib/redis.rb +2068 -464
  28. metadata +63 -160
  29. data/.gitignore +0 -10
  30. data/.order +0 -169
  31. data/.travis/Gemfile +0 -11
  32. data/.travis.yml +0 -50
  33. data/.yardopts +0 -3
  34. data/Rakefile +0 -392
  35. data/benchmarking/logging.rb +0 -62
  36. data/benchmarking/pipeline.rb +0 -51
  37. data/benchmarking/speed.rb +0 -21
  38. data/benchmarking/suite.rb +0 -24
  39. data/benchmarking/worker.rb +0 -71
  40. data/examples/basic.rb +0 -15
  41. data/examples/dist_redis.rb +0 -43
  42. data/examples/incr-decr.rb +0 -17
  43. data/examples/list.rb +0 -26
  44. data/examples/pubsub.rb +0 -31
  45. data/examples/sets.rb +0 -36
  46. data/examples/unicorn/config.ru +0 -3
  47. data/examples/unicorn/unicorn.rb +0 -20
  48. data/redis.gemspec +0 -41
  49. data/test/blocking_commands_test.rb +0 -42
  50. data/test/command_map_test.rb +0 -30
  51. data/test/commands_on_hashes_test.rb +0 -21
  52. data/test/commands_on_lists_test.rb +0 -20
  53. data/test/commands_on_sets_test.rb +0 -77
  54. data/test/commands_on_sorted_sets_test.rb +0 -109
  55. data/test/commands_on_strings_test.rb +0 -83
  56. data/test/commands_on_value_types_test.rb +0 -99
  57. data/test/connection_handling_test.rb +0 -189
  58. data/test/db/.gitignore +0 -1
  59. data/test/distributed_blocking_commands_test.rb +0 -46
  60. data/test/distributed_commands_on_hashes_test.rb +0 -10
  61. data/test/distributed_commands_on_lists_test.rb +0 -22
  62. data/test/distributed_commands_on_sets_test.rb +0 -83
  63. data/test/distributed_commands_on_sorted_sets_test.rb +0 -18
  64. data/test/distributed_commands_on_strings_test.rb +0 -48
  65. data/test/distributed_commands_on_value_types_test.rb +0 -87
  66. data/test/distributed_commands_requiring_clustering_test.rb +0 -148
  67. data/test/distributed_connection_handling_test.rb +0 -23
  68. data/test/distributed_internals_test.rb +0 -15
  69. data/test/distributed_key_tags_test.rb +0 -52
  70. data/test/distributed_persistence_control_commands_test.rb +0 -26
  71. data/test/distributed_publish_subscribe_test.rb +0 -92
  72. data/test/distributed_remote_server_control_commands_test.rb +0 -53
  73. data/test/distributed_scripting_test.rb +0 -102
  74. data/test/distributed_sorting_test.rb +0 -20
  75. data/test/distributed_test.rb +0 -58
  76. data/test/distributed_transactions_test.rb +0 -32
  77. data/test/encoding_test.rb +0 -18
  78. data/test/error_replies_test.rb +0 -59
  79. data/test/helper.rb +0 -188
  80. data/test/helper_test.rb +0 -22
  81. data/test/internals_test.rb +0 -214
  82. data/test/lint/blocking_commands.rb +0 -124
  83. data/test/lint/hashes.rb +0 -162
  84. data/test/lint/lists.rb +0 -143
  85. data/test/lint/sets.rb +0 -96
  86. data/test/lint/sorted_sets.rb +0 -201
  87. data/test/lint/strings.rb +0 -157
  88. data/test/lint/value_types.rb +0 -106
  89. data/test/persistence_control_commands_test.rb +0 -26
  90. data/test/pipelining_commands_test.rb +0 -195
  91. data/test/publish_subscribe_test.rb +0 -153
  92. data/test/remote_server_control_commands_test.rb +0 -104
  93. data/test/scripting_test.rb +0 -78
  94. data/test/sorting_test.rb +0 -45
  95. data/test/support/connection/hiredis.rb +0 -1
  96. data/test/support/connection/ruby.rb +0 -1
  97. data/test/support/connection/synchrony.rb +0 -17
  98. data/test/support/redis_mock.rb +0 -92
  99. data/test/support/wire/synchrony.rb +0 -24
  100. data/test/support/wire/thread.rb +0 -5
  101. data/test/synchrony_driver.rb +0 -57
  102. data/test/test.conf +0 -9
  103. data/test/thread_safety_test.rb +0 -32
  104. data/test/transactions_test.rb +0 -244
  105. data/test/unknown_commands_test.rb +0 -14
  106. data/test/url_param_test.rb +0 -64
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
5
- prerelease:
4
+ version: 4.5.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Ezra Zygmuntowicz
@@ -14,60 +13,77 @@ authors:
14
13
  - Michel Martens
15
14
  - Damian Janowski
16
15
  - Pieter Noordhuis
17
- autorequire:
16
+ autorequire:
18
17
  bindir: bin
19
18
  cert_chain: []
20
- date: 2012-05-23 00:00:00.000000000 Z
19
+ date: 2021-10-14 00:00:00.000000000 Z
21
20
  dependencies:
22
21
  - !ruby/object:Gem::Dependency
23
- name: rake
22
+ name: em-synchrony
24
23
  requirement: !ruby/object:Gem::Requirement
25
- none: false
26
24
  requirements:
27
- - - ! '>='
25
+ - - ">="
28
26
  - !ruby/object:Gem::Version
29
27
  version: '0'
30
28
  type: :development
31
29
  prerelease: false
32
30
  version_requirements: !ruby/object:Gem::Requirement
33
- none: false
34
31
  requirements:
35
- - - ! '>='
32
+ - - ">="
36
33
  - !ruby/object:Gem::Version
37
34
  version: '0'
38
- description: ! " A Ruby client that tries to match Redis' API one-to-one, while
39
- still\n providing an idiomatic interface. It features thread-safety,\n client-side
40
- sharding, pipelining, and an obsession for performance.\n"
35
+ - !ruby/object:Gem::Dependency
36
+ name: hiredis
37
+ requirement: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ type: :development
43
+ prerelease: false
44
+ version_requirements: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ - !ruby/object:Gem::Dependency
50
+ name: mocha
51
+ requirement: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ type: :development
57
+ prerelease: false
58
+ version_requirements: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ description: |2
64
+ A Ruby client that tries to match Redis' API one-to-one, while still
65
+ providing an idiomatic interface.
41
66
  email:
42
67
  - redis-db@googlegroups.com
43
68
  executables: []
44
69
  extensions: []
45
70
  extra_rdoc_files: []
46
71
  files:
47
- - .gitignore
48
- - .order
49
- - .travis.yml
50
- - .travis/Gemfile
51
- - .yardopts
52
72
  - CHANGELOG.md
53
73
  - LICENSE
54
74
  - README.md
55
- - Rakefile
56
- - benchmarking/logging.rb
57
- - benchmarking/pipeline.rb
58
- - benchmarking/speed.rb
59
- - benchmarking/suite.rb
60
- - benchmarking/worker.rb
61
- - examples/basic.rb
62
- - examples/dist_redis.rb
63
- - examples/incr-decr.rb
64
- - examples/list.rb
65
- - examples/pubsub.rb
66
- - examples/sets.rb
67
- - examples/unicorn/config.ru
68
- - examples/unicorn/unicorn.rb
69
75
  - lib/redis.rb
70
76
  - lib/redis/client.rb
77
+ - lib/redis/cluster.rb
78
+ - lib/redis/cluster/command.rb
79
+ - lib/redis/cluster/command_loader.rb
80
+ - lib/redis/cluster/key_slot_converter.rb
81
+ - lib/redis/cluster/node.rb
82
+ - lib/redis/cluster/node_key.rb
83
+ - lib/redis/cluster/node_loader.rb
84
+ - lib/redis/cluster/option.rb
85
+ - lib/redis/cluster/slot.rb
86
+ - lib/redis/cluster/slot_loader.rb
71
87
  - lib/redis/connection.rb
72
88
  - lib/redis/connection/command_helper.rb
73
89
  - lib/redis/connection/hiredis.rb
@@ -80,145 +96,32 @@ files:
80
96
  - lib/redis/pipeline.rb
81
97
  - lib/redis/subscribe.rb
82
98
  - lib/redis/version.rb
83
- - redis.gemspec
84
- - test/blocking_commands_test.rb
85
- - test/command_map_test.rb
86
- - test/commands_on_hashes_test.rb
87
- - test/commands_on_lists_test.rb
88
- - test/commands_on_sets_test.rb
89
- - test/commands_on_sorted_sets_test.rb
90
- - test/commands_on_strings_test.rb
91
- - test/commands_on_value_types_test.rb
92
- - test/connection_handling_test.rb
93
- - test/db/.gitignore
94
- - test/distributed_blocking_commands_test.rb
95
- - test/distributed_commands_on_hashes_test.rb
96
- - test/distributed_commands_on_lists_test.rb
97
- - test/distributed_commands_on_sets_test.rb
98
- - test/distributed_commands_on_sorted_sets_test.rb
99
- - test/distributed_commands_on_strings_test.rb
100
- - test/distributed_commands_on_value_types_test.rb
101
- - test/distributed_commands_requiring_clustering_test.rb
102
- - test/distributed_connection_handling_test.rb
103
- - test/distributed_internals_test.rb
104
- - test/distributed_key_tags_test.rb
105
- - test/distributed_persistence_control_commands_test.rb
106
- - test/distributed_publish_subscribe_test.rb
107
- - test/distributed_remote_server_control_commands_test.rb
108
- - test/distributed_scripting_test.rb
109
- - test/distributed_sorting_test.rb
110
- - test/distributed_test.rb
111
- - test/distributed_transactions_test.rb
112
- - test/encoding_test.rb
113
- - test/error_replies_test.rb
114
- - test/helper.rb
115
- - test/helper_test.rb
116
- - test/internals_test.rb
117
- - test/lint/blocking_commands.rb
118
- - test/lint/hashes.rb
119
- - test/lint/lists.rb
120
- - test/lint/sets.rb
121
- - test/lint/sorted_sets.rb
122
- - test/lint/strings.rb
123
- - test/lint/value_types.rb
124
- - test/persistence_control_commands_test.rb
125
- - test/pipelining_commands_test.rb
126
- - test/publish_subscribe_test.rb
127
- - test/remote_server_control_commands_test.rb
128
- - test/scripting_test.rb
129
- - test/sorting_test.rb
130
- - test/support/connection/hiredis.rb
131
- - test/support/connection/ruby.rb
132
- - test/support/connection/synchrony.rb
133
- - test/support/redis_mock.rb
134
- - test/support/wire/synchrony.rb
135
- - test/support/wire/thread.rb
136
- - test/synchrony_driver.rb
137
- - test/test.conf
138
- - test/thread_safety_test.rb
139
- - test/transactions_test.rb
140
- - test/unknown_commands_test.rb
141
- - test/url_param_test.rb
142
99
  homepage: https://github.com/redis/redis-rb
143
- licenses: []
144
- post_install_message:
100
+ licenses:
101
+ - MIT
102
+ metadata:
103
+ bug_tracker_uri: https://github.com/redis/redis-rb/issues
104
+ changelog_uri: https://github.com/redis/redis-rb/blob/master/CHANGELOG.md
105
+ documentation_uri: https://www.rubydoc.info/gems/redis/4.5.0
106
+ homepage_uri: https://github.com/redis/redis-rb
107
+ source_code_uri: https://github.com/redis/redis-rb/tree/v4.5.0
108
+ post_install_message:
145
109
  rdoc_options: []
146
110
  require_paths:
147
111
  - lib
148
112
  required_ruby_version: !ruby/object:Gem::Requirement
149
- none: false
150
113
  requirements:
151
- - - ! '>='
114
+ - - ">="
152
115
  - !ruby/object:Gem::Version
153
- version: '0'
116
+ version: 2.4.0
154
117
  required_rubygems_version: !ruby/object:Gem::Requirement
155
- none: false
156
118
  requirements:
157
- - - ! '>='
119
+ - - ">="
158
120
  - !ruby/object:Gem::Version
159
121
  version: '0'
160
122
  requirements: []
161
- rubyforge_project:
162
- rubygems_version: 1.8.23
163
- signing_key:
164
- specification_version: 3
123
+ rubygems_version: 3.1.2
124
+ signing_key:
125
+ specification_version: 4
165
126
  summary: A Ruby client library for Redis
166
- test_files:
167
- - test/blocking_commands_test.rb
168
- - test/command_map_test.rb
169
- - test/commands_on_hashes_test.rb
170
- - test/commands_on_lists_test.rb
171
- - test/commands_on_sets_test.rb
172
- - test/commands_on_sorted_sets_test.rb
173
- - test/commands_on_strings_test.rb
174
- - test/commands_on_value_types_test.rb
175
- - test/connection_handling_test.rb
176
- - test/db/.gitignore
177
- - test/distributed_blocking_commands_test.rb
178
- - test/distributed_commands_on_hashes_test.rb
179
- - test/distributed_commands_on_lists_test.rb
180
- - test/distributed_commands_on_sets_test.rb
181
- - test/distributed_commands_on_sorted_sets_test.rb
182
- - test/distributed_commands_on_strings_test.rb
183
- - test/distributed_commands_on_value_types_test.rb
184
- - test/distributed_commands_requiring_clustering_test.rb
185
- - test/distributed_connection_handling_test.rb
186
- - test/distributed_internals_test.rb
187
- - test/distributed_key_tags_test.rb
188
- - test/distributed_persistence_control_commands_test.rb
189
- - test/distributed_publish_subscribe_test.rb
190
- - test/distributed_remote_server_control_commands_test.rb
191
- - test/distributed_scripting_test.rb
192
- - test/distributed_sorting_test.rb
193
- - test/distributed_test.rb
194
- - test/distributed_transactions_test.rb
195
- - test/encoding_test.rb
196
- - test/error_replies_test.rb
197
- - test/helper.rb
198
- - test/helper_test.rb
199
- - test/internals_test.rb
200
- - test/lint/blocking_commands.rb
201
- - test/lint/hashes.rb
202
- - test/lint/lists.rb
203
- - test/lint/sets.rb
204
- - test/lint/sorted_sets.rb
205
- - test/lint/strings.rb
206
- - test/lint/value_types.rb
207
- - test/persistence_control_commands_test.rb
208
- - test/pipelining_commands_test.rb
209
- - test/publish_subscribe_test.rb
210
- - test/remote_server_control_commands_test.rb
211
- - test/scripting_test.rb
212
- - test/sorting_test.rb
213
- - test/support/connection/hiredis.rb
214
- - test/support/connection/ruby.rb
215
- - test/support/connection/synchrony.rb
216
- - test/support/redis_mock.rb
217
- - test/support/wire/synchrony.rb
218
- - test/support/wire/thread.rb
219
- - test/synchrony_driver.rb
220
- - test/test.conf
221
- - test/thread_safety_test.rb
222
- - test/transactions_test.rb
223
- - test/unknown_commands_test.rb
224
- - test/url_param_test.rb
127
+ test_files: []
data/.gitignore DELETED
@@ -1,10 +0,0 @@
1
- nohup.out
2
- redis/*
3
- rdsrv
4
- pkg/*
5
- coverage/*
6
- .idea
7
- *.rdb
8
- *.swp
9
- .yardoc
10
- doc/
data/.order DELETED
@@ -1,169 +0,0 @@
1
- {
2
- "connection": [
3
- "auth",
4
- "select",
5
- "ping",
6
- "echo",
7
- "quit"
8
- ],
9
- "server": [
10
- "bgrewriteaof",
11
- "bgsave",
12
- "config",
13
- "dbsize",
14
- "debug",
15
- "flushall",
16
- "flushdb",
17
- "info",
18
- "lastsave",
19
- "monitor",
20
- "save",
21
- "shutdown",
22
- "slaveof",
23
- "slowlog",
24
- "sync",
25
- "time"
26
- ],
27
- "generic": [
28
- "persist",
29
- "expire",
30
- "expireat",
31
- "ttl",
32
- "pexpire",
33
- "pexpireat",
34
- "pttl",
35
- "dump",
36
- "restore",
37
- "del",
38
- "exists",
39
- "keys",
40
- "migrate",
41
- "move",
42
- "object",
43
- "randomkey",
44
- "rename",
45
- "renamenx",
46
- "sort",
47
- "type"
48
- ],
49
- "string": [
50
- "decr",
51
- "decrby",
52
- "incr",
53
- "incrby",
54
- "incrbyfloat",
55
- "set",
56
- "setex",
57
- "psetex",
58
- "setnx",
59
- "mset",
60
- "mapped_mset",
61
- "msetnx",
62
- "mapped_msetnx",
63
- "get",
64
- "mget",
65
- "mapped_mget",
66
- "setrange",
67
- "getrange",
68
- "setbit",
69
- "getbit",
70
- "append",
71
- "bitcount",
72
- "getset",
73
- "strlen"
74
- ],
75
- "list": [
76
- "llen",
77
- "lpush",
78
- "lpushx",
79
- "rpush",
80
- "rpushx",
81
- "lpop",
82
- "rpop",
83
- "rpoplpush",
84
- "_bpop",
85
- "blpop",
86
- "brpop",
87
- "brpoplpush",
88
- "lindex",
89
- "linsert",
90
- "lrange",
91
- "lrem",
92
- "lset",
93
- "ltrim",
94
- "bitop"
95
- ],
96
- "set": [
97
- "scard",
98
- "sadd",
99
- "srem",
100
- "spop",
101
- "srandmember",
102
- "smove",
103
- "sismember",
104
- "smembers",
105
- "sdiff",
106
- "sdiffstore",
107
- "sinter",
108
- "sinterstore",
109
- "sunion",
110
- "sunionstore"
111
- ],
112
- "sorted_set": [
113
- "zcard",
114
- "zadd",
115
- "zincrby",
116
- "zrem",
117
- "zscore",
118
- "zrange",
119
- "zrevrange",
120
- "zrank",
121
- "zrevrank",
122
- "zremrangebyrank",
123
- "zrangebyscore",
124
- "zrevrangebyscore",
125
- "zremrangebyscore",
126
- "zcount",
127
- "zinterstore",
128
- "zunionstore"
129
- ],
130
- "hash": [
131
- "hlen",
132
- "hset",
133
- "hsetnx",
134
- "hmset",
135
- "mapped_hmset",
136
- "hget",
137
- "hmget",
138
- "mapped_hmget",
139
- "hdel",
140
- "hexists",
141
- "hincrby",
142
- "hincrbyfloat",
143
- "hkeys",
144
- "hvals",
145
- "hgetall"
146
- ],
147
- "pubsub": [
148
- "publish",
149
- "subscribed?",
150
- "subscribe",
151
- "unsubscribe",
152
- "psubscribe",
153
- "punsubscribe"
154
- ],
155
- "transactions": [
156
- "watch",
157
- "unwatch",
158
- "pipelined",
159
- "multi",
160
- "exec",
161
- "discard"
162
- ],
163
- "scripting": [
164
- "script",
165
- "_eval",
166
- "eval",
167
- "evalsha"
168
- ]
169
- }
data/.travis/Gemfile DELETED
@@ -1,11 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec :path => "../"
4
-
5
- case ENV["conn"]
6
- when "hiredis"
7
- gem "hiredis"
8
- when "synchrony"
9
- gem "hiredis"
10
- gem "em-synchrony"
11
- end
data/.travis.yml DELETED
@@ -1,50 +0,0 @@
1
- language: ruby
2
-
3
- branches:
4
- only:
5
- - master
6
- - test-unit
7
-
8
- rvm:
9
- - 1.8.7
10
- - 1.9.2
11
- - 1.9.3
12
- - jruby-18mode
13
- - jruby-19mode
14
-
15
- gemfile:
16
- - .travis/Gemfile
17
-
18
- env:
19
- - conn=ruby
20
- - conn=hiredis
21
- - conn=synchrony
22
-
23
- matrix:
24
- exclude:
25
- # hiredis
26
- - rvm: jruby-18mode
27
- gemfile: .travis/Gemfile
28
- env: conn=hiredis
29
- - rvm: jruby-19mode
30
- gemfile: .travis/Gemfile
31
- env: conn=hiredis
32
-
33
- # synchrony
34
- - rvm: 1.8.7
35
- gemfile: .travis/Gemfile
36
- env: conn=synchrony
37
- - rvm: jruby-18mode
38
- gemfile: .travis/Gemfile
39
- env: conn=synchrony
40
- - rvm: jruby-19mode
41
- gemfile: .travis/Gemfile
42
- env: conn=synchrony
43
-
44
- notifications:
45
- irc:
46
- - irc.freenode.net#redis-rb
47
- email:
48
- - damian.janowski@gmail.com
49
- - michel@soveran.com
50
- - pcnoordhuis@gmail.com
data/.yardopts DELETED
@@ -1,3 +0,0 @@
1
- --exclude redis/connection
2
- --exclude redis/compat
3
- --markup markdown