-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stream feature polish #811
Conversation
cc @supercaracal just so you know. |
- 2.3.3 | ||
- 2.4.1 | ||
- 2.5.0 | ||
- 2.3.8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the rubies to recent point releases, and dropped 2.2.x since it's now EOL. The matrix is already huge so we can't realistically test EOL versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we able to update required_ruby_version?
- DRIVER=ruby REDIS_BRANCH=4.0 | ||
- DRIVER=ruby REDIS_BRANCH=5.0 | ||
- DRIVER=hiredis REDIS_BRANCH=5.0 | ||
- DRIVER=synchrony REDIS_BRANCH=5.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea here is to test all the versions of the server with the ruby driver, but only the most recent one with the alternative drivers. I believe it's a good compromise between coverage and matrix size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps, do we need JRuby
x Redis 5.0
pattern?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the only one we should test actually IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@supercaracal another thing I spotted and I'd like your opinion on. >> pp r.xread('mystream', '0-0', block: 50_000)
{"mystream"=>
{"1544447512733-0"=>{"f1"=>"v1", "f2"=>"v2"},
"1544447564923-0"=>{"f1"=>"v2", "f2"=>"v5"}}} I wonder if it actually make sense, and if arrays wouldn't be more appropriate:
Granted, hashes are ordered in Ruby, but I'm not sure addressing the result by |
@byroot I think so too. I'm sorry. Hash is excessive abstraction. Array is more intuitive than Hash. |
No need to be sorry ! |
@supercaracal I pushed a change so that we use |
@byroot 👍 I agree it. It is match Redis' API one-to-one. There is no learning cost for user. |
Actually I'm now wondering if we should use named arguments at all for def xrange(key, start='-', _end='+', count: nil)
def xrevrange(key, _end='+', start='-', count: nil) That's probably as easy to use if not more ^ |
👍 It is more consistent than keyword arguments. e.g. |
Perhaps, we should use |
I think named arg for count make sense. I feel like a common use for xrange is "give me the last X events", so Another likely common use case is "give me events since X, but no more than 50", so |
Certainly. I understand. |
I'd say that the use cases of specifying XRANGE's I think that the following argument pattern is easy-to-use and consistent.
|
I'm not sure I understand the distinction you make between keyword and named arguments. Care to explain ? |
I'm sorry. I made a mistake. I chose wrong English word. |
I apologize for the above my confused comments. I mixed up the named arguments and the optional arguments. The named arguments are same as the keyword arguments. I'm sorry. If we should adjust to Redis command interface: # xread(key, start, _end, count = nil)
r.xread('s1', '-', '+')
r.xread('s1', '-', '+', 10)
r.xread('s1', '0-9', '+', 10)
If we have priority to easy-to-use interface in Ruby: # xread(key, start = '-', _end = '+', count: nil)
r.xread('s1')
r.xread('s1', count: 3)
r.xread('s1', '0-1')
r.xread('s1', '0-1', '0-9')
r.xread('s1', '0-1', count: 3)
I'd say that the latter looks good. |
43db834
to
35d77f7
Compare
35d77f7
to
60079e4
Compare
While playing with #799 locally, I realized it uses some modern Ruby feature like
Array#concat
varargs signature.This PR updates the builds matrix so that it spots more of this kind of issues.
I'll wait for the results and fix what comes up.