Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // none of the remaining methods are actually required by the cache directive - but they must be implemented to
- // satisfy the spray Cache trait. The equivalent methods offered by ConcurrentLinkedHashMap appeared to be async, but
- // with Caffeine we need to use the synchronous view.
- def remove(key: Any) = {
- Option(store.synchronous().asMap().remove(key)).map(value => Future.successful(value))
- }
- def clear(): Unit = store.synchronous().invalidateAll()
- def keys: Set[Any] = store.synchronous().asMap().keySet().asScala.toSet
- def ascendingKeys(limit: Option[Int] = None) = ???
- def size = store.synchronous().asMap().size()def remove(key: Any) = {
- Option(store.synchronous().asMap().remove(key)).map(value => Future.successful(value))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement