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.
|
boolean give(K key, V value)
key - value - V take(K key) throws InterruptedException
key - InterruptedExceptionFuture<V> asyncTake(K key) throws InterruptedException
key - InterruptedExceptionV poll(K key, long timeout, TimeUnit unit) throws InterruptedException
key - timeout - unit - InterruptedExceptionFuture<V> asyncPoll(K key, long timeout, TimeUnit unit) throws InterruptedException
key - InterruptedExceptionCopyright © 2001-2012 University Health Network. All Rights Reserved.