Skip to content

Instantly share code, notes, and snippets.

View codeomnitrix's full-sized avatar

Vinit Tiwari codeomnitrix

View GitHub Profile
import com.github.benmanes.caffeine.cache.Ticker
import com.github.blemale.scaffeine.Scaffeine
import scala.concurrent.duration.Duration
import scala.concurrent.{ExecutionContext, Future}
/**
*
* @param initialCapacity minimum total size for the internal hash tables
* @param maximumSize the maximum size of the cache
Feature EhCache Google Guava Caffeine
Performanc with 8 threads 11252172 Ops/sec 12434655 Ops/sec 181703298 Ops/sec
Async Loading No Not available out of the box Available out of box
Scala Support No ScalaCache provides google guava[however key can only be String] Scaffeine
User base 1.2k stars on Github 29k stars on Github 5k stars on Github
import pureconfig._
import com.typesafe.config.ConfigFactory
case class Person(id: Int, name: String, number: String)
object PureConfigTest extends App {
val person = loadConfig[Person](ConfigFactory.load("conf123/application.conf")) match {
case Right(conf) => conf
case Left(failures) =>