T
- The type of result produced by the task and expected by the
optional callback.public class AsyncResult<T> extends FutureTask<T>
FutureTask
that allows the user to register a callback
to be executed when the task's result is available.Constructor and Description |
---|
AsyncResult(Callable<T> callable)
Create a new task.
|
Modifier and Type | Method and Description |
---|---|
protected void |
done() |
void |
registerCallback(Callback<T> callback)
Register a callback to be executed when the task's result is available.
|
cancel, get, get, isCancelled, isDone, run, runAndReset, set, setException
public void registerCallback(Callback<T> callback)
callback
- The function to be called with the task's result.protected void done()
done
in class FutureTask<T>
Copyright © 2020. All rights reserved.