Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we switch the different caches in props? #183

Open
hongwei1 opened this issue May 18, 2018 · 1 comment
Open

Can we switch the different caches in props? #183

hongwei1 opened this issue May 18, 2018 · 1 comment

Comments

@hongwei1
Copy link

hongwei1 commented May 18, 2018

  implicit def anyToByte[T](implicit m: Manifest[T]) = new Codec[T, Array[Byte]] {
....
  }
  
  val underlyingGuavaCache: Cache[String, Object] = CacheBuilder.newBuilder().maximumSize(10000L).build[String, Object]
  val scalaCacheGuava = ScalaCache(GuavaCache(underlyingGuavaCache))
  
  val cacheType = config.getString("guava.cache.type")
  val scalaCacheRedis = ScalaCache(RedisCache("127.0.0.1", 6379))
  
  implicit val scalaCache= //scalaCacheRedis
  cacheType match {
    case value if value.toLowerCase == "redis" =>
      scalaCacheGuava// scalaCacheGuava 
    case _ =>
      scalaCacheRedis// scalaCacheGuava
  }
Error:(63, 54) not enough arguments for macro method memoizeSync: (implicit scalaCache: scalacache.ScalaCache[_1], implicit flags: scalacache.Flags, implicit codec: scalacache.serialization.Codec[String,_1])String.


Unspecified value parameter codec.
  def getLeumiBranchesFromBank: String = memoizeSync {
Error:(63, 54) Could not find any Codecs for type String and Repr. Please provide one or import scalacache._

```
@hongwei1
Copy link
Author

hongwei1 commented May 18, 2018

If I use single one type: scalaCacheGuava or scalaCacheRedis , everyone is working well.

But when I switch it in props, it throws the macro errors...

Do you have a solution for it ??

We need switch the different caches in props file...

@cb372 @rider-yi

@hongwei1 hongwei1 changed the title Can we switch the different cache in props? Can we switch the different caches in props? May 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant