Scalacache pass cache instance

2019-09-17 14:52发布

To initialise Scalacache instance in my service

import scala cache._    
implicit val scalaCache = ScalaCache(new MyCache())

but i am not getting what is new MyCache() so i have to pass a cache instance to construct a Scala Cache.

how to initialise mycache()

how to create a ScalaCache instance

reference : https://index.scala-lang.org/cb372/scalacache

标签: scala caching
1条回答
做个烂人
2楼-- · 2019-09-17 15:39

MyCache is some implementation of Cache trait. There is one for each of following:

The following cache implementations are supported, and it's easy to plugin your own implementation:

Google Guava

Memcached

Ehcache

Redis

Caffeine

Specific examples for each are given under https://github.com/cb372/scalacache#cache-implementations.

查看更多
登录 后发表回答