You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a utility similar to CallbackToFutureAdapter for invoking suspend
functions and returning a ListenableFuture for managing the operation in
progress.
Relnote: "Added SuspendToFutureAdapter for writing
suspend-ListenableFuture bridges"
Test: SuspendToFutureAdapterTest
Change-Id: Ia8a66143012dd3e5ceb2ba22a4a0d33ad7eb8fcc
method public static suspend <T> Object? await(com.google.common.util.concurrent.ListenableFuture<T>, kotlin.coroutines.Continuation<? super T>);
6
6
}
7
7
8
+
public final class SuspendToFutureAdapter {
9
+
method public <T> com.google.common.util.concurrent.ListenableFuture<T> launchFuture(optional kotlin.coroutines.CoroutineContext context, optional boolean launchUndispatched, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block);
10
+
field public static final androidx.concurrent.futures.SuspendToFutureAdapter INSTANCE;
method public static suspend <T> Object? await(com.google.common.util.concurrent.ListenableFuture<T>, kotlin.coroutines.Continuation<? super T>);
6
6
}
7
7
8
+
public final class SuspendToFutureAdapter {
9
+
method public <T> com.google.common.util.concurrent.ListenableFuture<T> launchFuture(optional kotlin.coroutines.CoroutineContext context, optional boolean launchUndispatched, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block);
10
+
field public static final androidx.concurrent.futures.SuspendToFutureAdapter INSTANCE;
method public static suspend <T> Object? await(com.google.common.util.concurrent.ListenableFuture<T>, kotlin.coroutines.Continuation<? super T>);
6
6
}
7
7
8
+
public final class SuspendToFutureAdapter {
9
+
method public <T> com.google.common.util.concurrent.ListenableFuture<T> launchFuture(optional kotlin.coroutines.CoroutineContext context, optional boolean launchUndispatched, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.Continuation<? super T>,?> block);
10
+
field public static final androidx.concurrent.futures.SuspendToFutureAdapter INSTANCE;
0 commit comments