AsyncSingleFuture

interface AsyncSingleFuture<T> : Future<T>

A Future that accepts a callback which consumes the result data asynchronously as well as blocking getter.

The callback has an associated executor or looper, and it is invoked 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 override fun get(): T

Waits if necessary for the request to complete, and then retrieves its result.

abstract operator override fun get(timeout: Long, unit: TimeUnit): T

Waits if necessary for the request to complete, but no longer than the specified time, and then retrieves its result, if available.

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

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.

Preferences Submitted

You have successfully updated your cookie preferences.