Lettuce (Redis)
libraryDependencies += "com.avast" %% "sst-lettuce" % "0.18.4"
This subproject initializes Lettuce Redis driver:
import cats.effect.Resource
import com.avast.sst.lettuce.{LettuceConfig, LettuceModule}
import io.lettuce.core.codec.{RedisCodec, StringCodec}
import zio.*
import zio.interop.catz.*
implicit val runtime: Runtime[ZEnv] = zio.Runtime.default // this is just needed in example
implicit val lettuceCodec: RedisCodec[String, String] = StringCodec.UTF8
for {
connection <- LettuceModule.makeConnection[Task, String, String](LettuceConfig("redis://localhost"))
value <- Resource.eval(Task.effect(connection.sync().get("key")))
} yield value