Convert device linking apis to use websockets.

This commit is contained in:
Cody Henthorne
2025-03-06 16:17:55 -05:00
committed by Michelle Tang
parent 451d12ed53
commit c38342e2fb
21 changed files with 334 additions and 200 deletions

View File

@@ -54,6 +54,8 @@ dependencies {
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.coroutines.core.jvm)
implementation(libs.google.libphonenumber)
implementation(libs.rxjava3.rxjava)
implementation(libs.rxjava3.rxkotlin)
testImplementation(testLibs.junit.junit)
testImplementation(testLibs.assertk)

View File

@@ -0,0 +1,30 @@
/*
* Copyright 2025 Signal Messenger, LLC
* SPDX-License-Identifier: AGPL-3.0-only
*/
@file:JvmName("JvmRxExtensions")
package org.signal.core.util.concurrent
import io.reactivex.rxjava3.core.Single
/**
* Throw an [InterruptedException] if a [Single.blockingGet] call is interrupted. This can
* happen when being called by code already within an Rx chain that is disposed.
*
* [Single.blockingGet] is considered harmful and should not be used.
*/
@Throws(InterruptedException::class)
fun <T : Any> Single<T>.safeBlockingGet(): T {
try {
return blockingGet()
} catch (e: RuntimeException) {
val cause = e.cause
if (cause is InterruptedException) {
throw cause
} else {
throw e
}
}
}