Skip to content

Instantly share code, notes, and snippets.

@debasishg
Created July 31, 2020 04:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save debasishg/13bad2673c9d7b1d28a8bd0e4be477fd to your computer and use it in GitHub Desktop.
Save debasishg/13bad2673c9d7b1d28a8bd0e4be477fd to your computer and use it in GitHub Desktop.
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