Interface BlockingCache<Key,Value>

All Superinterfaces:
Cache<Key,Value>
All Known Implementing Classes:
ShinyCache

public interface BlockingCache<Key,Value> extends Cache<Key,Value>
  • Method Summary

    Modifier and Type
    Method
    Description
    attempts to get a value from the Cache.
    getAndWait(Key key, long maxWaitMillis)
    attempt to get a value from the cache.

    Methods inherited from interface org.flasby.util.Cache

    get, iterator, size
  • Method Details

    • getAndWait

      Value getAndWait(Key key) throws InterruptedException
      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

      Value getAndWait(Key key, long maxWaitMillis) throws InterruptedException
      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