profunktor/redis4cats

setNx returns Unit

Closed this issue · 4 comments

Why does setNx returns Unit? I want to know the result of my query but with this API it seems impossible.

There are a bunch of methods defined this way where we discard the Java result as in most cases they are irrelevant. Eg. set returns a simple String "OK" in the Java API but we just represent it as F[Unit].

If having F[Boolean] would make you happy we can make that change :) Wanna work on this small PR?

And to be consistent all the *setNx methods need to change to F[Boolean].

Sure, I'd love to work on this!

Go ahead please @Twizty :)

@gvolpe I've changed functions signatures, and made a PR. Here it is.