AsyncCompletableFuture

A Future that accepts a callback which runs code after completion asynchronously as well as blocking await.

The callback has an associated executor or looper, and it is invoked by using this executor or looper once the async query in the future is complete. If the query has already completed when the callback is added, the listener executes immediately.

Since

1.0.0

Functions

Link copied to clipboard
abstract fun await()

Waits if necessary for the request to complete.

abstract fun await(timeout: Long, unit: TimeUnit)

Waits if necessary for the request to complete, but no longer than the specified time.

Link copied to clipboard
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.

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.

Preferences Submitted

You have successfully updated your cookie preferences.