Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 74 for callback (0.27 sec)

  1. okhttp/src/main/kotlin/okhttp3/Callback.kt

        e: IOException,
      )
    
      /**
       * Called when the HTTP response was successfully returned by the remote server. The callback may
       * proceed to read the response body with [Response.body]. The response is still live until its
       * response body is [closed][ResponseBody]. The recipient of the callback may consume the response
       * body on another thread.
       *
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.6K bytes
    - Viewed (0)
  2. okhttp-android/src/main/kotlin/okhttp3/android/AndroidAsyncDns.kt

      override fun query(
        hostname: String,
        callback: AsyncDns.Callback,
      ) {
        try {
          resolver.query(
            network,
            hostname,
            dnsClass.type,
            DnsResolver.FLAG_EMPTY,
            executor,
            null,
            object : DnsResolver.Callback<List<InetAddress>> {
              override fun onAnswer(
                addresses: List<InetAddress>,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 01 10:07:48 GMT 2024
    - 2.8K bytes
    - Viewed (0)
  3. okhttp-sse/src/main/kotlin/okhttp3/sse/internal/RealEventSource.kt

    import okhttp3.Call
    import okhttp3.Callback
    import okhttp3.Request
    import okhttp3.Response
    import okhttp3.ResponseBody
    import okhttp3.internal.stripBody
    import okhttp3.sse.EventSource
    import okhttp3.sse.EventSourceListener
    
    internal class RealEventSource(
      private val request: Request,
      private val listener: EventSourceListener,
    ) : EventSource, ServerSentEventReader.Callback, Callback {
      private var call: Call? = null
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.2K bytes
    - Viewed (0)
  4. okhttp-sse/src/main/kotlin/okhttp3/sse/internal/ServerSentEventReader.kt

      private val source: BufferedSource,
      private val callback: Callback,
    ) {
      private var lastId: String? = null
    
      interface Callback {
        fun onEvent(
          id: String?,
          type: String?,
          data: String,
        )
    
        fun onRetryChange(timeMs: Long)
      }
    
      /**
       * Process the next event. This will result in a single call to [Callback.onEvent] *unless* the
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.3K bytes
    - Viewed (0)
  5. okhttp-sse/src/test/java/okhttp3/sse/internal/ServerSentEventIteratorTest.kt

          |
          """.trimMargin(),
        )
        assertThat(callbacks).isEmpty()
      }
    
      private fun consumeEvents(source: String) {
        val callback: ServerSentEventReader.Callback =
          object : ServerSentEventReader.Callback {
            override fun onEvent(
              id: String?,
              type: String?,
              data: String,
            ) {
              callbacks.add(Event(id, type, data))
            }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 6.4K bytes
    - Viewed (0)
  6. okhttp-coroutines/src/test/kotlin/okhttp3/coroutines/ExecuteAsyncTest.kt

    import kotlinx.coroutines.withContext
    import kotlinx.coroutines.withTimeout
    import mockwebserver3.MockResponse
    import mockwebserver3.MockWebServer
    import mockwebserver3.SocketPolicy.DisconnectAfterRequest
    import okhttp3.Callback
    import okhttp3.FailingCall
    import okhttp3.HttpUrl.Companion.toHttpUrl
    import okhttp3.OkHttpClientTestRule
    import okhttp3.Protocol
    import okhttp3.Request
    import okhttp3.Response
    import okhttp3.ResponseBody
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 18 01:24:38 GMT 2024
    - 5.4K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/internal/connection/RealCall.kt

              responseCallback.onResponse(this@RealCall, response)
            } catch (e: IOException) {
              if (signalledCallback) {
                // Do not signal the callback twice!
                Platform.get().log("Callback failure for ${toLoggableString()}", Platform.INFO, e)
              } else {
                responseCallback.onFailure(this@RealCall, e)
              }
            } catch (t: Throwable) {
              cancel()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 17.9K bytes
    - Viewed (2)
  8. okhttp/src/test/java/okhttp3/DispatcherCleanupTest.kt

    import mockwebserver3.MockWebServer
    import org.junit.jupiter.api.Test
    
    class DispatcherCleanupTest {
      @Test
      fun testFinish(server: MockWebServer) {
        val okhttp = OkHttpClient()
        val callback =
          object : Callback {
            override fun onFailure(
              call: Call,
              e: IOException,
            ) {}
    
            override fun onResponse(
              call: Call,
              response: Response,
            ) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.2K bytes
    - Viewed (0)
  9. samples/guide/src/main/java/okhttp3/recipes/kt/YubikeyClientAuth.kt

      override fun handle(callbacks: Array<Callback>) {
        for (callback in callbacks) {
          if (callback is PasswordCallback) {
            val console = System.console()
    
            if (console != null) {
              callback.password = console.readPassword(callback.prompt)
            } else {
              System.err.println(callback.prompt)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.2K bytes
    - Viewed (1)
  10. okhttp-coroutines/src/main/kotlin/okhttp3/JvmCallExtensions.kt

    suspend fun Call.executeAsync(): Response =
      suspendCancellableCoroutine { continuation ->
        continuation.invokeOnCancellation {
          this.cancel()
        }
        this.enqueue(
          object : Callback {
            override fun onFailure(
              call: Call,
              e: IOException,
            ) {
              continuation.resumeWithException(e)
            }
    
            override fun onResponse(
              call: Call,
    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)
Back to top