Skip to content

Instantly share code, notes, and snippets.

@dnileshp
Created June 9, 2017 11:44
Show Gist options
  • Save dnileshp/94b844f1ed026427d388dfe31e126d50 to your computer and use it in GitHub Desktop.
Save dnileshp/94b844f1ed026427d388dfe31e126d50 to your computer and use it in GitHub Desktop.
ScalaCache in scala
import scalacache.memcached.MemcachedCache
/**
* Created by dnilesh on 9/6/17.
*
*/
class ScalaCache {
import scalacache._
import memoization._
implicit val scalaCache = ScalaCache(MemcachedCache("127.0.0.1:11211"))
import scala.concurrent.duration._
def GetWipUsersByRole(request: RequestDTO) : ResponseDTO = memoizeSync(7.days) {
// method specific implementation.
ResponseDTO
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment