CallbackToFutureAdapter.Completer

public static final class CallbackToFutureAdapter.Completer
extends Object

java.lang.Object
   ↳ androidx.concurrent.futures.CallbackToFutureAdapter.Completer<T>


Used to complete the future returned by CallbackToFutureAdapter.getFuture(CallbackToFutureAdapter.Resolver)

Summary

Public methods

void addCancellationListener(Runnable runnable, Executor executor)

Use to propagate cancellation from the future to whatever operation is using this Completer.

boolean set(T value)

Sets the result of the Future unless the Future has already been cancelled or set.

boolean setCancelled()

Cancels Future unless the Future has already been cancelled or set.

boolean setException(Throwable t)

Sets the failed result of the Future unless the Future has already been cancelled or set.

Protected methods

void finalize()

Inherited methods

Public methods

addCancellationListener

public void addCancellationListener (Runnable runnable, 
                Executor executor)

Use to propagate cancellation from the future to whatever operation is using this Completer.

Will be called when the returned Future is cancelled by Future.cancel(boolean) or this Completer object is garbage collected before the future completes. Not triggered by setCancelled().

Parameters