Skip to content
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

Support GETEX and GETDEL #340

Merged
merged 10 commits into from
Apr 13, 2021
Merged

Support GETEX and GETDEL #340

merged 10 commits into from
Apr 13, 2021

Conversation

jxnu-liguobin
Copy link
Collaborator

closed #334

@jxnu-liguobin jxnu-liguobin requested a review from a team as a code owner April 6, 2021 10:14
_ <- ZIO.sleep(20.millis)
res <- get(key)
} yield assert(res.isDefined)(equalTo(true)) && assert(exists)(equalTo(Some(value)))
} @@ eventually,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question why is this test @eventually?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because sleep is unreliable and subject to CPU and thread scheduling. 20ms is likely to cause failure. Here, it is similar to CAS. (guess)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah true, I forgot that we use the Live Clock in these tests.

}
case object GetExInput extends Input[(String, Expire, Duration)] {
override private[redis] def encode(data: (String, Expire, Duration)): Chunk[RespValue.BulkString] =
case class GetExPersistInput[K: Schema]() extends Input[(K, Boolean)] {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Case classes should be final.

case object GetExInput extends Input[(String, Expire, Duration)] {
override private[redis] def encode(data: (String, Expire, Duration)): Chunk[RespValue.BulkString] =
case class GetExPersistInput[K: Schema]() extends Input[(K, Boolean)] {
override private[redis] def encode(data: (K, Boolean))(implicit codec: Codec): Chunk[RespValue.BulkString] =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove override private. I noticed that some of the recently added inputs are using it, but please remove it everywhere together with the ones from this PR.

@hcwilhelm
Copy link
Contributor

Please mark all test wich use generators eg checkM(...) { } with @@ flaky

@hcwilhelm
Copy link
Contributor

👍

@mijicd mijicd merged commit 000f9ae into zio:master Apr 13, 2021
@jxnu-liguobin jxnu-liguobin deleted the support-getEx branch May 1, 2021 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support GETEX and GETDEL
3 participants