protocol-redis 0.13.0 → 0.13.1
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
- checksums.yaml.gz.sig +0 -0
- data/context/index.yaml +2 -0
- data/lib/protocol/redis/cluster/methods/streams.rb +7 -7
- data/lib/protocol/redis/connection.rb +24 -15
- data/lib/protocol/redis/version.rb +1 -1
- data/license.md +1 -1
- data/readme.md +23 -7
- data/releases.md +4 -0
- data.tar.gz.sig +0 -0
- metadata +5 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 13bddcefe812f04cac9130c565ef34dc0c0a31d3de85e510ac13d8191f02a0cc
|
|
4
|
+
data.tar.gz: 78c2898bb6b3c0d7d365eba345758615a2c6d9a7e57ed9cf534819ae5b582eb0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1d373f1fb921e78847f90aebd248e864919a0d5dde74c293d809358f13371cd789352fcf72e0d2b97faedc3799d283262d410658fca5551f28664c2f3d27b918
|
|
7
|
+
data.tar.gz: d616c4c2a988c0e4416ae9760d5b8b2497aaeb4c63c3b34c2ea6e33144cf714fb251cc066db2065f20aebbd6aa1865f8a69cc14a57f1b933f0ea552063c68bce
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/context/index.yaml
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
---
|
|
4
4
|
description: A transport agnostic RESP protocol client/server.
|
|
5
5
|
metadata:
|
|
6
|
+
bug_tracker_uri: https://github.com/socketry/protocol-redis/issues
|
|
7
|
+
changelog_uri: https://github.com/socketry/protocol-redis/blob/main/releases.md
|
|
6
8
|
documentation_uri: https://socketry.github.io/protocol-redis/
|
|
7
9
|
funding_uri: https://github.com/sponsors/ioquatix
|
|
8
10
|
source_code_uri: https://github.com/socketry/protocol-redis.git
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
# Released under the MIT License.
|
|
4
|
-
# Copyright, 2025, by Samuel Williams.
|
|
4
|
+
# Copyright, 2025-2026, by Samuel Williams.
|
|
5
5
|
|
|
6
6
|
module Protocol
|
|
7
7
|
module Redis
|
|
@@ -128,12 +128,12 @@ module Protocol
|
|
|
128
128
|
def xgroup(*arguments, role: :master)
|
|
129
129
|
# Extract stream key (usually third argument for CREATE, second for others):
|
|
130
130
|
stream_key = case arguments[0]&.upcase
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
131
|
+
when "CREATE", "SETID"
|
|
132
|
+
arguments[1] # CREATE stream group id, SETID stream group id
|
|
133
|
+
when "DESTROY", "DELCONSUMER"
|
|
134
|
+
arguments[1] # DESTROY stream group, DELCONSUMER stream group consumer
|
|
135
|
+
else
|
|
136
|
+
arguments[1] if arguments.length > 1
|
|
137
137
|
end
|
|
138
138
|
|
|
139
139
|
if stream_key
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
# Released under the MIT License.
|
|
4
|
-
# Copyright, 2019-
|
|
4
|
+
# Copyright, 2019-2026, by Samuel Williams.
|
|
5
5
|
|
|
6
6
|
require_relative "error"
|
|
7
7
|
|
|
@@ -103,8 +103,12 @@ module Protocol
|
|
|
103
103
|
# @raises [ServerError] If the server returns an error response.
|
|
104
104
|
# @raises [EOFError] If the stream reaches end of file.
|
|
105
105
|
def read_object
|
|
106
|
-
|
|
106
|
+
# Whether the current response was fully consumed:
|
|
107
|
+
complete = false
|
|
108
|
+
object = nil
|
|
107
109
|
|
|
110
|
+
# The line that we are processing:
|
|
111
|
+
line = read_line or raise EOFError
|
|
108
112
|
token = line.slice!(0, 1)
|
|
109
113
|
|
|
110
114
|
case token
|
|
@@ -112,35 +116,40 @@ module Protocol
|
|
|
112
116
|
length = line.to_i
|
|
113
117
|
|
|
114
118
|
if length == -1
|
|
115
|
-
|
|
119
|
+
# No data.
|
|
116
120
|
else
|
|
117
|
-
|
|
121
|
+
object = read_data(length)
|
|
118
122
|
end
|
|
123
|
+
|
|
124
|
+
complete = true
|
|
119
125
|
when "*"
|
|
120
126
|
count = line.to_i
|
|
121
127
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
128
|
+
if count == -1
|
|
129
|
+
# Null array (https://redis.io/topics/protocol#resp-arrays).
|
|
130
|
+
else
|
|
131
|
+
object = Array.new(count){read_object}
|
|
132
|
+
end
|
|
126
133
|
|
|
127
|
-
|
|
134
|
+
complete = true
|
|
128
135
|
when ":"
|
|
129
|
-
|
|
130
|
-
|
|
136
|
+
object = line.to_i
|
|
137
|
+
complete = true
|
|
131
138
|
when "-"
|
|
139
|
+
complete = true
|
|
132
140
|
raise ServerError.new(line)
|
|
133
|
-
|
|
134
141
|
when "+"
|
|
135
|
-
|
|
136
|
-
|
|
142
|
+
object = line
|
|
143
|
+
complete = true
|
|
137
144
|
else
|
|
138
145
|
@stream.flush
|
|
139
146
|
|
|
140
147
|
raise UnknownTokenError, token.inspect
|
|
141
148
|
end
|
|
142
149
|
|
|
143
|
-
|
|
150
|
+
return object
|
|
151
|
+
ensure
|
|
152
|
+
close unless complete
|
|
144
153
|
end
|
|
145
154
|
|
|
146
155
|
alias read_response read_object
|
data/license.md
CHANGED
data/readme.md
CHANGED
|
@@ -14,6 +14,10 @@ Please see the [project documentation](https://socketry.github.io/protocol-redis
|
|
|
14
14
|
|
|
15
15
|
Please see the [project releases](https://socketry.github.io/protocol-redis/releases/index) for all releases.
|
|
16
16
|
|
|
17
|
+
### v0.13.1
|
|
18
|
+
|
|
19
|
+
- Close connections when reading a response fails before it is fully consumed.
|
|
20
|
+
|
|
17
21
|
### v0.13.0
|
|
18
22
|
|
|
19
23
|
- Handle `nil` return value in `hgetall` method.
|
|
@@ -57,19 +61,31 @@ Please see the [project releases](https://socketry.github.io/protocol-redis/rele
|
|
|
57
61
|
|
|
58
62
|
- Add support for multi-argument auth.
|
|
59
63
|
|
|
60
|
-
### v0.6.0
|
|
61
|
-
|
|
62
|
-
- Add relevant pubsub method group.
|
|
63
|
-
|
|
64
64
|
## Contributing
|
|
65
65
|
|
|
66
66
|
We welcome contributions to this project.
|
|
67
67
|
|
|
68
|
-
1. Fork
|
|
68
|
+
1. Fork the repository.
|
|
69
69
|
2. Create your feature branch (`git checkout -b my-new-feature`).
|
|
70
|
-
3. Commit your changes (`git commit -am 'Add some feature'`).
|
|
70
|
+
3. Commit your changes (`git commit -am 'Add some feature.'`).
|
|
71
71
|
4. Push to the branch (`git push origin my-new-feature`).
|
|
72
|
-
5. Create new
|
|
72
|
+
5. Create a new pull request.
|
|
73
|
+
|
|
74
|
+
### Running Tests
|
|
75
|
+
|
|
76
|
+
To run the test suite:
|
|
77
|
+
|
|
78
|
+
``` bash
|
|
79
|
+
$ bundle exec sus
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Making Releases
|
|
83
|
+
|
|
84
|
+
To make a new release:
|
|
85
|
+
|
|
86
|
+
``` bash
|
|
87
|
+
$ bundle exec bake gem:release:patch # or minor or major
|
|
88
|
+
```
|
|
73
89
|
|
|
74
90
|
### Developer Certificate of Origin
|
|
75
91
|
|
data/releases.md
CHANGED
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: protocol-redis
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.13.
|
|
4
|
+
version: 0.13.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Samuel Williams
|
|
@@ -84,6 +84,8 @@ homepage: https://github.com/socketry/protocol-redis
|
|
|
84
84
|
licenses:
|
|
85
85
|
- MIT
|
|
86
86
|
metadata:
|
|
87
|
+
bug_tracker_uri: https://github.com/socketry/protocol-redis/issues
|
|
88
|
+
changelog_uri: https://github.com/socketry/protocol-redis/blob/main/releases.md
|
|
87
89
|
documentation_uri: https://socketry.github.io/protocol-redis/
|
|
88
90
|
funding_uri: https://github.com/sponsors/ioquatix
|
|
89
91
|
source_code_uri: https://github.com/socketry/protocol-redis.git
|
|
@@ -94,14 +96,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
94
96
|
requirements:
|
|
95
97
|
- - ">="
|
|
96
98
|
- !ruby/object:Gem::Version
|
|
97
|
-
version: '3.
|
|
99
|
+
version: '3.3'
|
|
98
100
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
101
|
requirements:
|
|
100
102
|
- - ">="
|
|
101
103
|
- !ruby/object:Gem::Version
|
|
102
104
|
version: '0'
|
|
103
105
|
requirements: []
|
|
104
|
-
rubygems_version:
|
|
106
|
+
rubygems_version: 4.0.10
|
|
105
107
|
specification_version: 4
|
|
106
108
|
summary: A transport agnostic RESP protocol client/server.
|
|
107
109
|
test_files: []
|
metadata.gz.sig
CHANGED
|
Binary file
|