Skip to content

codeengio/kartoffel

Repository files navigation

kartoffel

Usage

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")

About

Async Scala cache implementation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages