SHARE
TWEET

Untitled

a guest Jan 11th, 2017 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // none of the remaining methods are actually required by the cache directive - but they must be implemented to
  2.   // satisfy the spray Cache trait. The equivalent methods offered by ConcurrentLinkedHashMap appeared to be async, but
  3.   // with Caffeine we need to use the synchronous view.
  4.  
  5.   def remove(key: Any) = {
  6.     Option(store.synchronous().asMap().remove(key)).map(value => Future.successful(value))
  7.   }
  8.  
  9.   def clear(): Unit = store.synchronous().invalidateAll()
  10.  
  11.   def keys: Set[Any] = store.synchronous().asMap().keySet().asScala.toSet
  12.  
  13.   def ascendingKeys(limit: Option[Int] = None) = ???
  14.  
  15.   def size = store.synchronous().asMap().size()def remove(key: Any) = {
  16.     Option(store.synchronous().asMap().remove(key)).map(value => Future.successful(value))
  17.   }
RAW Paste Data
Top