Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

ResolvableFuture

class ResolvableFuture<V : Any!> : AbstractResolvableFuture<V>
kotlin.Any
   ↳ androidx.concurrent.futures.AbstractResolvableFuture<V>
   ↳ androidx.concurrent.futures.ResolvableFuture

An AndroidX version of Guava's SettableFuture.

A ListenableFuture whose result can be set by a set(Object), or setFuture(ListenableFuture) call. It can also, like any other Future, be cancelled.

If your needs are more complex than ResolvableFuture supports, use , which offers an extensible version of the API.

Summary

Public methods
Boolean
setException(throwable: Throwable!)

Boolean
setFuture(future: ListenableFuture<out V>!)

Boolean
set(@Nullable value: V?)

static ResolvableFuture<V>!

Creates a new ResolvableFuture that can be completed or cancelled by a later method call.

Inherited functions

Public methods

setException

fun setException(throwable: Throwable!): Boolean

setFuture

fun setFuture(future: ListenableFuture<out V>!): Boolean

set

fun set(@Nullable value: V?): Boolean

create

static fun <V : Any!> create(): ResolvableFuture<V>!

Creates a new ResolvableFuture that can be completed or cancelled by a later method call.