public class AsyncResult<R> extends Object implements IAsyncResult<R>
| Constructor and Description |
|---|
AsyncResult(ExecutorService pExecutorService,
IWorker<T,R> pImpl,
T pWork)
Executes command with custom callable.
|
AsyncResult(R pResult) |
| Modifier and Type | Method and Description |
|---|---|
R |
get()
Wait for result to be available and return them.
|
R |
get(long pTimeout,
TimeUnit pTimeUnit)
Wait for result to be available up until timeout specified.
|
void |
setCallback(Callback<R> pCallback)
Set "method" to be called when result is available.
|
public AsyncResult(ExecutorService pExecutorService, IWorker<T,R> pImpl, T pWork)
T - TypepExecutorService - Executor ServicepImpl - ImplementationpWork - Workpublic AsyncResult(R pResult)
public void setCallback(Callback<R> pCallback) throws Exception
IAsyncResultsetCallback in interface IAsyncResult<R>pCallback - CallbackException - Exceptionpublic R get() throws Exception
IAsyncResultget in interface IAsyncResult<R>Exception - Exceptionpublic R get(long pTimeout, TimeUnit pTimeUnit) throws Exception
IAsyncResultget in interface IAsyncResult<R>pTimeout - TimeoutpTimeUnit - Time unitException - Exceptionlpezet