Package org.flasby.util
Interface BlockingCache<Key,Value>
- All Superinterfaces:
Cache<Key,
Value>
- All Known Implementing Classes:
ShinyCache
-
Method Summary
Modifier and TypeMethodDescriptiongetAndWait
(Key key) attempts to get a value from the Cache.getAndWait
(Key key, long maxWaitMillis) attempt to get a value from the cache.
-
Method Details
-
getAndWait
attempts to get a value from the Cache. If a previous request to populate the cache with the value for this key is in progress, then the current thread should block until the cache is populated.- Parameters:
key
-- Returns:
- Throws:
InterruptedException
-
getAndWait
attempt to get a value from the cache. If a previous request to populate the cache with the value for this key is in progress, then the current thread will block for at most maxWaitMillis until the cache is populated. Should no value become available within this maxWait time then the cache will return null.- Parameters:
key
-maxWaitMillis
-- Returns:
- Throws:
InterruptedException
-