OnCancelListener#onCancelled()
is called.Promise
.ExecutorService
Runnable
to be executed on a background threadThreadPool.Config.ConfigBuilder
Runnable
to be executed on the UI thread.Executor
FutureTask
that implements the Promise
interface to provide completion, failure, and cancellation
callbacks.Callable
Callable
and provide an Executor
for the callbacks.Runnable
Runnable
and provide an Executor
for the callbacks.Promise.isDone()
Promise.OnCancelListener
callback to be notified on cancellationPromise.OnCompleteListener
callback to be notified of completionPromise.OnFailListener
callback to be notified on failurePromise
interface is very similar to a Future
, but it provides
callbacks for completion, failure, and cancellationPromise
that can be retrofitted into any asynchronous flow:
Instantiate a SimplePromise
Interact with the SimplePromise
instance in your runnable running in the background
Return the instantiated SimplePromise
in the calling thread
Runnable
on the background thread.Runnable
on the background thread.Runnable
on the background thread.Executor
that executes code on the UI Thread and an ExecutorService
that allows
for code to be executed on a background thread via a Threadpool.ThreadPool.Config
builder.