Class Promise.Task<T>
java.lang.Object
org.eclipse.jetty.util.Promise.Task<T>
- Type Parameters:
 T- the type of the result of the task
A Promise that implements Runnable to perform
a one-shot task that eventually completes this Promise.
Subclasses override Runnable.run() to implement the task.
Users of this class start the task execution via Runnable.run().
Typical usage:
// Specify what to do in case of success and failure.
Promise.Task<T> task = new Promise.Task<>(() -> onSuccess(), x -> onFailure(x))
{
    @Override
    public void run()
    {
        try
        {
            // Perform some task.
            T result = performTask();
            // Eventually succeed this Promise.
            succeeded(result);
        }
        catch (Throwable x)
        {
            // Fail this Promise.
            failed(x);
        }
    }
}
// Start the task.
task.run();
- 
Nested Class Summary
Nested classes/interfaces inherited from interface Promise
Promise.Completable<S>, Promise.Invocable<R>, Promise.Task<T>, Promise.Wrapper<W> - 
Constructor Summary
Constructors - 
Method Summary
 
- 
Constructor Details
- 
Task
public Task() - 
Task
 
 - 
 - 
Method Details
- 
succeeded
 - 
failed
 
 -