Created
July 31, 2020 04:59
-
-
Save debasishg/13bad2673c9d7b1d28a8bd0e4be477fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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