- Sort Score
- Result 10 results
- Languages All
Results 1 - 6 of 6 for ExecuteAsync (0.11 sec)
-
okhttp-coroutines/src/main/kotlin/okhttp3/coroutines/ExecuteAsync.kt
import okhttp3.Call import okhttp3.Callback import okhttp3.Response import okhttp3.internal.closeQuietly import okio.IOException @ExperimentalCoroutinesApi // resume with a resource cleanup. suspend fun Call.executeAsync(): Response = suspendCancellableCoroutine { continuation -> continuation.invokeOnCancellation { this.cancel() } this.enqueue( object : Callback { override fun onFailure(
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Thu Apr 18 01:24:38 UTC 2024 - 1.5K bytes - Viewed (0) -
okhttp-coroutines/src/test/kotlin/okhttp3/coroutines/ExecuteAsyncTest.kt
this.server = server } @Test fun suspendCall() { runTest { server.enqueue(MockResponse(body = "abc")) val call = client.newCall(request) call.executeAsync().use { withContext(Dispatchers.IO) { assertThat(it.body.string()).isEqualTo("abc") } } } } @Test fun timeoutCall() { runTest { server.enqueue(
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Thu Apr 18 01:24:38 UTC 2024 - 5.4K bytes - Viewed (0) -
samples/tlssurvey/src/main/kotlin/okhttp3/survey/Iana.kt
* limitations under the License. */ package okhttp3.survey import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.coroutines.executeAsync import okhttp3.survey.types.SuiteId import okio.ByteString.Companion.decodeHex import okio.IOException /** Example: "0x00,0x08",TLS_RSA_EXPORT_WITH_DES40_CBC_SHA,Y,N,[RFC4346] */
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Thu Apr 18 01:24:38 UTC 2024 - 2K bytes - Viewed (0) -
okhttp-coroutines/README.md
OkHttp Coroutines ================= Support for Kotlin clients using coroutines. ```kotlin val call = client.newCall(request) call.executeAsync().use { response -> withContext(Dispatchers.IO) { println(response.body?.string()) } } ``` This is implemented using `suspendCancellableCoroutine` but uses the standard Dispatcher in OkHttp. This means that by default Kotlin's Dispatchers are not used.
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Thu Nov 09 15:47:27 UTC 2023 - 609 bytes - Viewed (0) -
okhttp-coroutines/api/okhttp-coroutines.api
public final class okhttp3/coroutines/ExecuteAsyncKt { public static final fun executeAsync (Lokhttp3/Call;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Thu Apr 18 01:24:38 UTC 2024 - 163 bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/internal/publicsuffix/PublicSuffixListGenerator.kt
import java.util.TreeSet import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.coroutines.executeAsync import okhttp3.internal.publicsuffix.PublicSuffixDatabase.Companion.PUBLIC_SUFFIX_RESOURCE import okio.BufferedSink import okio.ByteString import okio.ByteString.Companion.encodeUtf8 import okio.FileSystem
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Thu Apr 18 01:24:38 UTC 2024 - 6K bytes - Viewed (0)