Created
February 9, 2018 22:23
-
-
Save bandrzejczak/6f51abc6ed693d7334f10519b9c90ca6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scalacache._ | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import scalacache.modes.scalaFuture._ | |
implicit val cache: Cache[Token] = ??? | |
def obtainTokenFor(userId: String): Future[(Token, Duration)] = ??? | |
val userId = "123" | |
cachingWithTTL(userId)(obtainTokenFor(userId)) // yields Future[Token] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment