public interface BlockingMap<K,V> extends Map<K,V>
| Modifier and Type | Method and Description |
|---|---|
Future<V> |
asyncPoll(K key,
long timeout,
TimeUnit unit)
Polls for an entry in a background thread.
|
Future<V> |
asyncTake(K key)
Waits for an entry in a background thread.
|
boolean |
give(K key,
V value)
Adds an entry only if there's already a consumer waiting for the value.
|
V |
poll(K key,
long timeout,
TimeUnit unit)
Waits for the specified amount of time for an entry with the given key
and returns the associated value.
|
V |
take(K key)
Waits for an entry for the given key and returns the associated value.
|
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesboolean give(K key, V value)
key - key for the entry to be addedvalue - entry to be addedV take(K key) throws InterruptedException
key - key for the entryInterruptedExceptionFuture<V> asyncTake(K key) throws InterruptedException
key - key for the entryInterruptedExceptionV poll(K key, long timeout, TimeUnit unit) throws InterruptedException
key - key for the entrytimeout - timeout before the methods returnsunit - time unit used in conjunction with timoutInterruptedExceptionFuture<V> asyncPoll(K key, long timeout, TimeUnit unit) throws InterruptedException
key - key for the entryInterruptedExceptionCopyright © 2001–2017 University Health Network. All rights reserved.