Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for dispatch (0.18 sec)

  1. okhttp/src/test/java/okhttp3/CallTest.kt

       */
      @Test
      fun canceledBeforeIOSignalsOnFailure() {
        // Force requests to be executed serially.
        val dispatcher = Dispatcher(client.dispatcher.executorService)
        dispatcher.maxRequests = 1
        client =
          client.newBuilder()
            .dispatcher(dispatcher)
            .build()
        val requestA = Request(server.url("/a"))
        val requestB = Request(server.url("/b"))
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 142.5K bytes
    - Viewed (0)
  2. mockwebserver/src/main/kotlin/mockwebserver3/MockWebServer.kt

      /**
       * The dispatcher used to respond to HTTP requests. The default dispatcher is a [QueueDispatcher],
       * which serves a fixed sequence of responses from a [queue][enqueue].
       *
       * Other dispatchers can be configured. They can vary the response based on timing or the content
       * of the request.
       */
      var dispatcher: Dispatcher = QueueDispatcher()
    
      private var portField: Int = -1
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Mar 31 17:16:15 GMT 2024
    - 37.4K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/internal/http2/HttpOverHttp2Test.kt

        // We use a re-entrant dispatcher to initiate one HTTPS connection while the other is in flight.
        server.dispatcher =
          object : Dispatcher() {
            var requestCount = 0
    
            override fun dispatch(request: RecordedRequest): MockResponse {
              val result = queueDispatcher.dispatch(request)
              requestCount++
              if (requestCount == 1) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 75.3K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/internal/connection/RealCall.kt

        callStart()
        try {
          client.dispatcher.executed(this)
          return getResponseWithInterceptorChain()
        } finally {
          client.dispatcher.finished(this)
        }
      }
    
      override fun enqueue(responseCallback: Callback) {
        check(executed.compareAndSet(false, true)) { "Already Executed" }
    
        callStart()
        client.dispatcher.enqueue(AsyncCall(responseCallback))
      }
    
    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)
  5. okhttp/src/test/java/okhttp3/KotlinSourceModernTest.kt

      }
    
      @Test
      fun dispatcher() {
        var dispatcher = Dispatcher()
        dispatcher = Dispatcher(Executors.newCachedThreadPool())
        val maxRequests: Int = dispatcher.maxRequests
        dispatcher.maxRequests = 0
        val maxRequestsPerHost: Int = dispatcher.maxRequestsPerHost
        dispatcher.maxRequestsPerHost = 0
        val executorService: ExecutorService = dispatcher.executorService
    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)
  6. okhttp/src/main/kotlin/okhttp3/internal/connection/RealConnection.kt

        lock.assertHeld()
    
        val routeUrl = route.address.url
    
        if (url.port != routeUrl.port) {
          return false // Port mismatch.
        }
    
        if (url.host == routeUrl.host) {
          return true // Host match. The URL is supported.
        }
    
        // We have a host mismatch. But if the certificate matches, we're still good.
        return !noCoalescedConnections && handshake != null && certificateSupportHost(url, handshake!!)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 15.4K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/internal/ws/WebSocketHttpTest.kt

       * byte of a frame but no more frames.
       */
      @Test
      fun readTimeoutAppliesWithinFrames() {
        webServer.dispatcher =
          object : Dispatcher() {
            override fun dispatch(request: RecordedRequest): MockResponse {
              return upgradeResponse(request)
                .body(Buffer().write("81".decodeHex())) // Truncated frame.
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Mar 31 17:16:15 GMT 2024
    - 35.2K bytes
    - Viewed (1)
  8. okhttp/src/main/kotlin/okhttp3/Dispatcher.kt

    import okhttp3.internal.threadFactory
    
    /**
     * Policy on when async requests are executed.
     *
     * Each dispatcher uses an [ExecutorService] to run calls internally. If you supply your own
     * executor, it should be able to run [the configured maximum][maxRequests] number of calls
     * concurrently.
     */
    class Dispatcher() {
      internal val lock: ReentrantLock = ReentrantLock()
    
      /**
    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)
  9. okhttp/src/test/java/okhttp3/DispatcherTest.kt

        object : WebSocketListener() {
        }
      val dispatcher = Dispatcher(executor)
      val listener = RecordingEventListener()
      var client =
        clientTestRule.newClientBuilder()
          .dns { throw UnknownHostException() }
          .dispatcher(dispatcher)
          .eventListenerFactory(clientTestRule.wrap(listener))
          .build()
    
      @BeforeEach
      fun setUp() {
        dispatcher.maxRequests = 20
        dispatcher.maxRequestsPerHost = 10
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Apr 05 03:30:42 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  10. okhttp/src/main/kotlin/okhttp3/OkHttpClient.kt

          this.taskRunner = okHttpClient.taskRunner
        }
    
        /**
         * Sets the dispatcher used to set policy and execute asynchronous requests. Must not be null.
         */
        fun dispatcher(dispatcher: Dispatcher) =
          apply {
            this.dispatcher = dispatcher
          }
    
        /**
         * Sets the connection pool used to recycle HTTP and HTTPS connections.
         *
    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