public class NotifyingFutureTask
extends java.util.concurrent.FutureTask<java.lang.Void>
Future
that accepts completion listener. The listener is invoked
once the future's computation is complete.
If the computation has already completed when the listener is added, the
listener will execute immediately.
Listener is invoked synchronously on the same thread which is used to executed the Future
Constructor and Description |
---|
NotifyingFutureTask(java.util.concurrent.Callable<java.lang.Void> callable) |
NotifyingFutureTask(java.lang.Runnable task) |
Modifier and Type | Method and Description |
---|---|
static NotifyingFutureTask |
completed() |
void |
onComplete(java.lang.Runnable onComplete)
Set the on complete handler.
|
public NotifyingFutureTask(java.util.concurrent.Callable<java.lang.Void> callable)
public NotifyingFutureTask(java.lang.Runnable task)
public void onComplete(java.lang.Runnable onComplete)
Note: there is no guarantee to which handler will run when the method is called multiple times with different arguments.
onComplete
- listener to invoke upon completionpublic static NotifyingFutureTask completed()
Copyright © 2010 - 2020 Adobe. All Rights Reserved