public static class ThreadPool.SingletonResult<T>
extends java.lang.Object
Singletons
as a token
that can be used to await the completion of submitted work.Constructor and Description |
---|
SingletonResult(int msAwaitDefault,
ThreadPool.Singleton<T> singleton,
java.util.concurrent.Future<T> future) |
Modifier and Type | Method and Description |
---|---|
T |
await()
Awaits (until deadline, forever, or until interruption) the completion of
the work item associated with this result.
|
T |
await(long ms)
Awaits the completion of the work item associated with this result.
|
void |
setFuture(java.util.concurrent.Future<T> future) |
public SingletonResult(int msAwaitDefault, ThreadPool.Singleton<T> singleton, java.util.concurrent.Future<T> future)
public void setFuture(java.util.concurrent.Future<T> future)
public T await(long ms) throws java.lang.InterruptedException
ms
- the duration in milliseconds to waitjava.lang.InterruptedException
ThreadPool.Singleton.submit(int, Runnable)
public T await() throws java.lang.InterruptedException
java.lang.InterruptedException
ThreadPool.Singleton.submit(int, Runnable)