# ListenableFutureKt

Added in 1.4.0-alpha01

*** ** * ** ***

<br />

```
public final class ListenableFutureKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull T` | `<T extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/concurrent/futures/ListenableFutureKt#(com.google.common.util.concurrent.ListenableFuture).await()(@https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> receiver)` Awaits completion of `this` `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` without blocking a thread. |

## Public methods

### await

Artifact: [androidx.concurrent:concurrent-futures](https://developer.android.com/jetpack/androidx/releases/concurrent) [View Source](https://cs.android.com/search?q=file:androidx/concurrent/futures/ListenableFuture.kt+function:await)

```
public static final @NonNull T <T extends Object> await(@NonNull ListenableFuture<@NonNull T> receiver)
```

Awaits completion of `this` `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` without blocking a thread.

This suspend function is cancellable.

If the `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-job/index.html` of the current coroutine is cancelled or completed while this suspending function is waiting, this function stops waiting for the future and immediately resumes with `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-cancellation-exception/index.html`.

This method is intended to be used with one-shot Futures, so on coroutine cancellation, the Future is cancelled as well. If cancelling the given future is undesired, use `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-non-cancellable/index.html`.