Package kotlinx.coroutines.guava

Functions

asDeferred
Link copied to clipboard
fun <T> ListenableFuture<T>.asDeferred(): Deferred<T>

Returns a Deferred that is completed or failed by thisListenableFuture.

asListenableFuture
Link copied to clipboard
fun <T> Deferred<T>.asListenableFuture(): ListenableFuture<T>

Returns a ListenableFuture that is completed or failed by thisDeferred.

await
Link copied to clipboard
suspend fun <T> ListenableFuture<T>.await(): T

Awaits completion of thisListenableFuture without blocking a thread.

future
Link copied to clipboard
fun <T> CoroutineScope.future(context: CoroutineContext = EmptyCoroutineContext, start: CoroutineStart = CoroutineStart.DEFAULT, block: suspend CoroutineScope.() -> T): ListenableFuture<T>

Starts block in a new coroutine and returns a ListenableFuture pointing to its result.