setCallback

abstract fun setCallback(executor: Executor, onSuccess: Consumer<in T>, onError: Consumer<in Throwable>)

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

The onCompleted runs and the result is delivered to it 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.

onSuccess

Consumer callback to run when the execution is successful to get a result.

onError

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


abstract fun setCallback(looper: Looper, onSuccess: Consumer<in T>, onError: Consumer<in Throwable>)

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

The onCompleted runs and the result is delivered to it when the Future's execution is complete or, if the execution is already complete, immediately.

If an exception occurs during the execution, onError will run 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.

onSuccess

Consumer callback to run when the execution is successful to get a result.

onError

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

Preferences Submitted

You have successfully updated your cookie preferences.