Connection API

Purely functional interface for the Connection API.

Connection Commands usage

Once you have acquired a connection you can start using it:

import cats.effect.IO

def putStrLn(str: String): IO[Unit] = IO(println(str))

commandsApi.use { redis => // ConnectionCommands[IO, String]
  val clientName = "client_x"
  for {
    _ <- redis.ping.flatMap(putStrLn) // "pong"
    _ <- redis.setClientName(clientName) // true
    retrievedClientName <- redis.getClientName()
    _ <- putStrLn(retrievedClientName.getOrElse("")) // "client_x"
  } yield ()
}