-
Notifications
You must be signed in to change notification settings - Fork 23.5k
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
Turn PERSIST command into variadic. #9062
base: unstable
Are you sure you want to change the base?
Conversation
AFAIK not all commands that can be turned into variadic were changed. For EXPIRE, there's really no problem. For TTL, we can argue that we can't (easily) since it'll change the response type. however, i'm not sure we wanna go down that road.. specifically about multi-key commands. @redis/core-team please share your thoughts if you have any.. |
@oranagra What I mean all commands is like |
EXPIRE doesn't need to have the same TTL for all keys, it can use |
I misunderstand. EXPIRE is OK. I missed it. |
The only concern I have is that making this variadic locks down future extensions to the command structure. It is also weird that the inverse, EXPIRE (and the other variants we have now), is not variadic. So I would be more inclined if we were to make all of TTL type commands variadic, which seems complicated based on oran's comment. Another issue I've recently become aware is that for clients in statically typed languages, it's painful to return different types of responses for the same command, so changing the return type based on the argument is not a great option. So my net vote is no, let's not do this. |
I don't like changing the return type based on the argument idea too. |
I think we need to either handle all (EXPIRE, PERSIST, TTL, EXPIREAT, EXPIRETIME), or none. I'm willing to overlook the concern @madolson shared about blocking future extensions to the command. if needed we'll be forced to add another command. with regards to clients on typed languages, i suppose they can keep supporting a so bottom line, i think we should only handle that if we handle all of them, and it seems that it's not that simple to decide on how to do it. |
Thanks for reply. At first, I just think make this command variadic is simple and compatible. I didn't think too much deeper. So maybe someday this is really needed we can do it. |
|
As I know all commands which can be turned into variadic compatibly were done but
PERSIST
.In fact variadic
PERSIST
uses less code. So I think it's reasonable to turn it into variadic.