Import desired async context:
import scala.concurrent.ExecutionContext.Implicits.global
import kartoffel.async.futureAsync
Available async contexts are:
import kartoffel.async.futureAsync
import kartoffel.async.cats.catsAsync
import kartoffel.async.zio.zioAsync
Create a serializer and a deserializer implicit values:
private implicit val serializer: CacheSerializer[String, String] = (value: String) => value
private implicit val deserializer: CacheDeserializer[String, String] = (serialized: String) => serialized
Create an instance of cache implementation:
val cache = CaffeineCache[String]()
// Put value
val putResult: Future[String] = cache.put("test", "test")
val getResult: Future[String] = cache.get("test")