-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Implement msetex command #3510
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
base: main
Are you sure you want to change the base?
Implement msetex command #3510
Conversation
tishun
left a comment
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.
LGTM
| * | ||
| * @param map the map of keys and values. | ||
| * @return Boolean from integer-reply: {@code 1} if all keys were set, {@code 0} otherwise. | ||
| */ |
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.
It would be good to add here an annotation on when the command was added. Assuming we will be adding new features in the next minor release then
@since 7.1Do not forget to rebuild all the interfaces after that ...
| * | ||
| * @param map the map of keys and values. | ||
| * @param args the {@link MSetExArgs} specifying NX/XX and expiration. | ||
| * @return Boolean from integer-reply: {@code 1} if all keys were set, {@code 0} otherwise. |
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.
same here
| * <p> | ||
| * Construct via {@link #builder()} to ensure type-safe sequencing (condition → expiration → build). NX/XX are mutually | ||
| * exclusive, and at most one expiration can be specified. Instances are intended for single use within a command invocation. | ||
| * |
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.
@since 7.1| public interface ExpirationStep { | ||
|
|
||
| /** Set expire time in seconds (EX). */ | ||
| BuildStep ex(long seconds); |
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.
lets use only the Duration API approach, I would suggest that we keep the API surface as small as possible
(again - applicable to all usages of long to define seconds expirations)
| * unix-time-seconds | PXAT unix-time-milliseconds | KEEPTTL]. | ||
| * | ||
| * <p> | ||
| * Construct via {@link #builder()} to ensure type-safe sequencing (condition → expiration → build). NX/XX are mutually |
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.
Nice!
resolves #3500