43 lines
1.7 KiB
Java
43 lines
1.7 KiB
Java
|
package com.discord.utilities.coroutines;
|
||
|
|
||
|
import android.content.Context;
|
||
|
import c.q.a.k.a;
|
||
|
import d0.w.g.c;
|
||
|
import d0.w.h.a.g;
|
||
|
import d0.z.d.m;
|
||
|
import kotlin.coroutines.Continuation;
|
||
|
import rx.Observable;
|
||
|
import s.a.a.r;
|
||
|
/* compiled from: RxCoroutineExtensions.kt */
|
||
|
public final class RxCoroutineExtensionsKt {
|
||
|
public static final <T> Object appAwaitFirst(Observable<T> observable, Context context, Continuation<? super T> continuation) {
|
||
|
Observable<T> y2 = observable.y();
|
||
|
m.checkNotNullExpressionValue(y2, "first()");
|
||
|
return appAwaitSingle(y2, context, continuation);
|
||
|
}
|
||
|
|
||
|
public static /* synthetic */ Object appAwaitFirst$default(Observable observable, Context context, Continuation continuation, int i, Object obj) {
|
||
|
if ((i & 1) != 0) {
|
||
|
context = null;
|
||
|
}
|
||
|
return appAwaitFirst(observable, context, continuation);
|
||
|
}
|
||
|
|
||
|
public static final <T> Object appAwaitSingle(Observable<T> observable, Context context, Continuation<? super T> continuation) {
|
||
|
RxCoroutineExtensionsKt$appAwaitSingle$2 rxCoroutineExtensionsKt$appAwaitSingle$2 = new RxCoroutineExtensionsKt$appAwaitSingle$2(observable, context, null);
|
||
|
r rVar = new r(continuation.getContext(), continuation);
|
||
|
Object T = a.T(rVar, rVar, rxCoroutineExtensionsKt$appAwaitSingle$2);
|
||
|
if (T == c.getCOROUTINE_SUSPENDED()) {
|
||
|
g.probeCoroutineSuspended(continuation);
|
||
|
}
|
||
|
return T;
|
||
|
}
|
||
|
|
||
|
public static /* synthetic */ Object appAwaitSingle$default(Observable observable, Context context, Continuation continuation, int i, Object obj) {
|
||
|
if ((i & 1) != 0) {
|
||
|
context = null;
|
||
|
}
|
||
|
return appAwaitSingle(observable, context, continuation);
|
||
|
}
|
||
|
}
|