-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a typed API for more typesafe caching
Use of the typed API means you can't accidentally put something of the wrong type into your cache. e.g. ``` import scalacache._ implicit val sc: ScalaCache = ... val intCache = typed[Int] intCache.put("one")(1) // OK intCache.put("two")(2.0) // Nope! Compiler error val one = intCache.get("1") // returns a Future[Option[Int]] ``` Use of the typed API is optional. Users can still use the existing, un-typesafe API if they prefer to play fast and loose with their types.
- Loading branch information
Showing
1 changed file
with
102 additions
and
56 deletions.
There are no files selected for viewing
This file contains 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