setCallback

abstract fun setCallback(executor: Executor, onCompleted: Runnable, onError: Consumer<in Throwable>)

Sets a callback and an error handler to be run on the specified executor.

The onCompleted runs when the Future's execution is complete or, if the execution is already complete, immediately. If an exception occurs during the execution, onError runs and the exception is passed to the handler.

Since

1.0.0

Parameters

executor

The Executor on which the callback is run.

onCompleted

Runnable callback to run when the execution is completed.

onError

Consumer error handler to run when the execution fails. All exceptions listed in await can be supplied to this onError handler


abstract fun setCallback(looper: Looper, onCompleted: Runnable, onError: Consumer<in Throwable>)

Sets a callback and an error handler to be run on the thread of the specified looper.

The onCompleted runs when the Future's execution is complete or, if the execution is already complete, immediately. If an exception occurs during the execution, onError runs and the exception is passed to the handler.

Since

1.0.0

Parameters

looper

The Looper of the thread on which the callback is run.

onCompleted

Runnable callback to run when the execution is completed.

onError

Consumer error handler to run when the execution fails. All exceptions listed in await can be supplied to this onError handler

Preferences Submitted

You have successfully updated your cookie preferences.