Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import java.net.URI
import cats.effect._
object Main extends IOApp {
override def run(args: List[String]): IO[ExitCode] =
RedisClient.makeWithURI[IO](new URI("http://localhost:6379")).use { cmd =>
import cmd._
val result = for {
_ <- set("key1", "debasish ghosh")
_ <- set("key2", 100)
_ <- set("key3", true)
d <- get("key1")
p <- incrby("key2", 12)
a <- mget("key1", "key2", "key3")
} yield (d, p, a)
println(result.unsafeRunSync())
IO(ExitCode.Success)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment