ListenableFutureKt

public final class ListenableFutureKt


Summary

Public methods

static final @NonNull T
<T extends Object> ListenableFutureKt.await(
    @NonNull ListenableFuture<@NonNull T> receiver
)

Awaits completion of thisListenableFuture without blocking a thread.

Public methods

ListenableFutureKt.await

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

Awaits completion of thisListenableFuture without blocking a thread.

This suspend function is cancellable.

If the kotlinx.coroutines.Job 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 CancellationException.

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 kotlinx.coroutines.NonCancellable.