OnCancelListener#onCancelled() is called.Promise.ExecutorServiceRunnable to be executed on a background threadThreadPool.Config.ConfigBuilderRunnable to be executed on the UI thread.ExecutorFutureTask that implements the Promise interface to provide completion, failure, and cancellation
callbacks.CallableCallable and provide an Executor for the callbacks.RunnableRunnable 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.