zio / zio-redis

A ZIO-based redis client
https://zio.github.io/zio-redis
Apache License 2.0
123 stars 63 forks source link

Support for infinity in sorted set commands params & results #981

Closed maizy closed 4 months ago

maizy commented 4 months ago

+inf, -inf are supported as a score in redis sorted set commands.

Infinity can be passed as a parameter to ZADD and received as a result from Z*WITHSCORE, ZSCORE, ZMSCORE, BZPOP* etc.

In the model we can map ±inf to Double.PositiveInfinity and Double.NegativeInfinity.

Strange thing: despite the fact that +inf is passed as a parameter with a plus at the end, it returns as inf without +.

It's a part of #352, which I'm going to implement later.