Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 74 for Callbacks (0.27 sec)

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

    interface AsyncDns {
      /**
       * Query DNS records for `hostname`, in the order they are received.
       */
      fun query(
        hostname: String,
        callback: Callback,
      )
    
      /**
       * Callback to receive results from the DNS Queries.
       */
      @ExperimentalOkHttpApi
      interface Callback {
        /**
         * Return addresses for a dns query for a single class of IPv4 (A) or IPv6 (AAAA).
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 23 14:31:42 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  2. samples/guide/src/main/java/okhttp3/recipes/kt/AsynchronousGet.kt

    import okhttp3.Call
    import okhttp3.Callback
    import okhttp3.OkHttpClient
    import okhttp3.Request
    import okhttp3.Response
    
    class AsynchronousGet {
      private val client = OkHttpClient()
    
      fun run() {
        val request =
          Request.Builder()
            .url("http://publicobject.com/helloworld.txt")
            .build()
    
        client.newCall(request).enqueue(
          object : Callback {
            override fun onFailure(
    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)
  3. okhttp/src/main/kotlin/okhttp3/Dispatcher.kt

        }
    
      /**
       * A callback to be invoked each time the dispatcher becomes idle (when the number of running
       * calls returns to zero).
       *
       * Note: The time at which a [call][Call] is considered idle is different depending on whether it
       * was run [asynchronously][Call.enqueue] or [synchronously][Call.execute]. Asynchronous calls
       * become idle after the [onResponse][Callback.onResponse] or [onFailure][Callback.onFailure]
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 9K bytes
    - Viewed (0)
  4. CHANGELOG.md

    ## Version 5.0.0-alpha.4
    
    _2022-02-01_
    
    **This release introduces fast fallback to better support mixed IPv4+IPv6 networks.** Fast fallback
    is what we're calling our implementation of Happy Eyeballs, [RFC 8305][rfc_8305]. With this
    feature OkHttp will attempt both IPv6 and IPv4 connections concurrently, keeping whichever connects
    first. Fast fallback gives IPv6 connections a 250 ms head start so IPv6 is preferred on networks
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 18 01:31:39 GMT 2024
    - 21.4K bytes
    - Viewed (0)
  5. okhttp-coroutines/src/test/kotlin/okhttp3/SuspendCallTest.kt

        var responseClosed = false
        var canceled = false
        var afterCallbackOnResponse: () -> Unit = {}
    
        override fun cancel() {
          canceled = true
        }
    
        override fun enqueue(responseCallback: Callback) {
          responseCallback.onResponse(this, response)
          afterCallbackOnResponse()
        }
      }
    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)
  6. okhttp/src/test/java/okhttp3/EventListenerTest.kt

        )
        val call =
          client.newCall(
            Request.Builder()
              .url(server.url("/"))
              .build(),
          )
        val completionLatch = CountDownLatch(1)
        val callback: Callback =
          object : Callback {
            override fun onFailure(
              call: Call,
              e: IOException,
            ) {
              completionLatch.countDown()
            }
    
            override fun onResponse(
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 56.9K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/KotlinSourceModernTest.kt

            override fun enqueue(responseCallback: Callback) = TODO()
    
            override fun cancel() = TODO()
    
            override fun isExecuted(): Boolean = TODO()
    
            override fun isCanceled(): Boolean = TODO()
    
            override fun timeout(): Timeout = TODO()
    
            override fun clone(): Call = TODO()
          }
      }
    
      @Test
      fun callback() {
        val callback =
          object : Callback {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 01 14:21:25 GMT 2024
    - 46.5K bytes
    - Viewed (4)
  8. okhttp-testing-support/src/main/kotlin/okhttp3/RecordingEventListener.kt

      /** The timestamp of the last taken event, used to measure elapsed time between events. */
      private var lastTimestampNs: Long? = null
    
      /** Confirm that the thread does not hold a lock on `lock` during the callback. */
      fun forbidLock(lock: Any) {
        forbiddenLocks.add(lock)
      }
    
      /**
       * Removes recorded events up to (and including) an event is found whose class equals [eventClass]
       * and returns it.
       */
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9K bytes
    - Viewed (1)
  9. okhttp/src/main/kotlin/okhttp3/internal/ws/RealWebSocket.kt

    import java.net.SocketTimeoutException
    import java.util.ArrayDeque
    import java.util.Random
    import java.util.concurrent.TimeUnit
    import java.util.concurrent.TimeUnit.MILLISECONDS
    import okhttp3.Call
    import okhttp3.Callback
    import okhttp3.EventListener
    import okhttp3.OkHttpClient
    import okhttp3.Protocol
    import okhttp3.Request
    import okhttp3.Response
    import okhttp3.WebSocket
    import okhttp3.WebSocketListener
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 01 14:21:25 GMT 2024
    - 22.1K bytes
    - Viewed (0)
  10. okhttp/src/main/kotlin/okhttp3/OkHttpClient.kt

        fun retryOnConnectionFailure(retryOnConnectionFailure: Boolean) =
          apply {
            this.retryOnConnectionFailure = retryOnConnectionFailure
          }
    
        /**
         * Configure this client to perform fast fallbacks by attempting multiple connections
         * concurrently, returning once any connection connects successfully.
         *
         * This implements Happy Eyeballs ([RFC 6555][rfc_6555]), balancing connect latency vs.
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 04:21:33 GMT 2024
    - 52K bytes
    - Viewed (0)
Back to top