Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for executeAsync (0.3 sec)

  1. 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(
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Apr 18 01:24:38 GMT 2024
    - 1.5K bytes
    - Viewed (0)
  2. 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(
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Apr 18 01:24:38 GMT 2024
    - 5.4K bytes
    - Viewed (0)
  3. okhttp-coroutines/src/test/kotlin/okhttp3/SuspendCallTest.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(
    Plain Text
    - Registered: Fri Apr 12 11:42:09 GMT 2024
    - Last Modified: Fri Apr 05 11:25:23 GMT 2024
    - 5.3K bytes
    - Viewed (0)
  4. 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] */
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Apr 18 01:24:38 GMT 2024
    - 2K bytes
    - Viewed (0)
  5. 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
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Apr 18 01:24:38 GMT 2024
    - 6K bytes
    - Viewed (0)
  6. 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;
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Apr 18 01:24:38 GMT 2024
    - 163 bytes
    - Viewed (0)
  7. okhttp-coroutines/src/main/kotlin/okhttp3/JvmCallExtensions.kt

    import kotlinx.coroutines.suspendCancellableCoroutine
    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(
    Plain Text
    - Registered: Fri Apr 12 11:42:09 GMT 2024
    - Last Modified: Fri Apr 05 11:25:23 GMT 2024
    - 1.4K bytes
    - Viewed (0)
  8. 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.
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Nov 09 15:47:27 GMT 2023
    - 609 bytes
    - Viewed (0)
  9. okhttp-android/src/main/baseline-prof.txt

    HSPLokhttp3/JvmCallExtensionsKt$executeAsync$2$1;-><init>(Lokhttp3/Call;)V
    HSPLokhttp3/JvmCallExtensionsKt$executeAsync$2$2$onResponse$1;-><init>(Lokhttp3/Call;)V
    HSPLokhttp3/JvmCallExtensionsKt$executeAsync$2$2;-><init>(Lkotlinx/coroutines/CancellableContinuation;)V
    HSPLokhttp3/JvmCallExtensionsKt$executeAsync$2$2;->onFailure(Lokhttp3/Call;Ljava/io/IOException;)V
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Mar 21 11:22:00 GMT 2022
    - 127.9K bytes
    - Viewed (0)
  10. CHANGELOG.md

        for a graceful shutdown before it performs an abrupt shutdown.
    
     *  Fix: Honor `RequestBody.isOneShot()` in `MultipartBody`
    
     *  Fix in `okhttp-coroutines`: Don't leak response bodies in `executeAsync()`. We had a bug where
        we didn't call `Response.close()` if the coroutine was canceled before its response was
        returned.
    
     *  Upgrade: [Okio 3.9.0][okio_3_9_0].
    
     *  Upgrade: [Kotlin 1.9.23][kotlin_1_9_23].
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Apr 18 01:31:39 GMT 2024
    - 21.4K bytes
    - Viewed (0)
Back to top