forked from acrosa/scala-redis
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
remake SET implementation #250
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
debasishg
reviewed
Sep 5, 2019
atais
force-pushed
the
duration
branch
2 times, most recently
from
September 5, 2019 20:56
e0e1d52
to
4134176
Compare
How about removing the currently deprecated version, deprecating the
current version and adding the new one. Considering the number of users it
will be too much to change the public API all on a sudden. Thanks a ton for
all the hard work that u r putting into this but we need to be careful with
breaking changes. I know many people use this library in production.
On Fri, 6 Sep 2019 at 2:35 AM, Michał Siatkowski ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/main/scala/com/redis/StringOperations.scala
<#250 (comment)>:
> trait StringOperations extends StringApi {
self: Redis =>
- override def set(key: Any, value: Any)(implicit format: Format): Boolean =
- send("SET", List(key, value))(asBoolean)
-
- @deprecated("Use the more typesafe variant", "2.14")
- def set(key: Any, value: Any, nxxx: Any, expx: Any, time: Long): Boolean = {
- send("SET", List(key, value, nxxx, expx, time))(asBoolean)
- }
-
- override def set(key: Any, value: Any, onlyIfExists: Boolean, time: SecondsOrMillis): Boolean = {
- val nxxx = if (onlyIfExists) "XX" else "NX"
- val expx = time match {
- case Seconds(v) => List("EX", v)
- case Millis(v) => List("PX", v)
+ override def set(key: Any, value: Any, whenSet: SetBehaviour = Always, expire: Duration = null)
+ (implicit format: Format): Boolean = {
I was thinking about keeping old implementation or not and these are
things that convinced me
1. It is not a new feature, but a cleanup. You don't need to update if
you like the old API
2. The other implementations are back from 2010 - 2015. It is time to
move on.
3. It is just making more and more mess in the class and the project,
I really see no point in keeping untyped version from 2013 or
SecondsOrMilliseconds from 2015. Its 2019.
please reconsider.
Or maybe it is worth making a branch 4.0 and we can merge it there.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#250?email_source=notifications&email_token=AAA2FX6WXKXZPMDTGG3H663QIFYCLA5CNFSM4IUCHIOKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCD23XWI#discussion_r321480863>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAA2FX4I2MEJHIZ56PGD7JLQIFYCLANCNFSM4IUCHIOA>
.
--
Sent from my iPhone
|
@debasishg seems like a good tradeoff. The default call (without the params) is cross-compatible. |
debasishg
approved these changes
Sep 7, 2019
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixing the issues: