Scalacache pass cache instance

你。 提交于 2020-01-26 03:37:27

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/44451323/scalacache-pass-cache-instance

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!