Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 27 for Dispatcher (0.08 sec)

  1. okhttp/src/commonJvmAndroid/kotlin/okhttp3/Dispatcher.kt

    import okhttp3.internal.unmodifiable
    
    /**
     * 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() {
      /**
       * The maximum number of requests to execute concurrently. Above this requests queue in memory,
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Tue Oct 07 14:16:22 UTC 2025
    - 9.9K bytes
    - Viewed (0)
  2. okhttp/src/jvmTest/kotlin/okhttp3/DispatcherTest.kt

        object : WebSocketListener() {
        }
      val dispatcher = Dispatcher(executor)
      val eventRecorder = EventRecorder()
      var client =
        clientTestRule
          .newClientBuilder()
          .dns { throw UnknownHostException() }
          .dispatcher(dispatcher)
          .eventListenerFactory(clientTestRule.wrap(eventRecorder))
          .build()
    
      @BeforeEach
      fun setUp() {
        dispatcher.maxRequests = 20
        dispatcher.maxRequestsPerHost = 10
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Tue Nov 04 19:13:52 UTC 2025
    - 15.8K bytes
    - Viewed (0)
  3. okhttp-logging-interceptor/src/main/kotlin/okhttp3/logging/LoggingEventListener.kt

      }
    
      override fun dispatcherQueueStart(
        call: Call,
        dispatcher: Dispatcher,
      ) {
        logWithTime("dispatcherQueueStart: $call queuedCallsCount=${dispatcher.queuedCallsCount()}")
      }
    
      override fun dispatcherQueueEnd(
        call: Call,
        dispatcher: Dispatcher,
      ) {
        logWithTime("dispatcherQueueEnd: $call queuedCallsCount=${dispatcher.queuedCallsCount()}")
      }
    
      override fun proxySelectStart(
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Mon Oct 06 13:40:20 UTC 2025
    - 5.8K bytes
    - Viewed (0)
  4. okhttp/src/jvmTest/kotlin/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
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Wed Nov 05 18:28:35 UTC 2025
    - 47K bytes
    - Viewed (0)
  5. okhttp-testing-support/src/main/kotlin/okhttp3/EventListenerAdapter.kt

        }
      }
    
      override fun dispatcherQueueStart(
        call: Call,
        dispatcher: Dispatcher,
      ) = onEvent(DispatcherQueueStart(System.nanoTime(), call, dispatcher))
    
      override fun dispatcherQueueEnd(
        call: Call,
        dispatcher: Dispatcher,
      ) = onEvent(DispatcherQueueEnd(System.nanoTime(), call, dispatcher))
    
      override fun proxySelectStart(
        call: Call,
        url: HttpUrl,
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Tue Nov 04 19:13:52 UTC 2025
    - 7.1K bytes
    - Viewed (0)
  6. okhttp/src/commonJvmAndroid/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.
         *
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Tue Oct 07 21:55:03 UTC 2025
    - 51.4K bytes
    - Viewed (0)
  7. okhttp/src/commonJvmAndroid/kotlin/okhttp3/EventListener.kt

          call: Call,
          dispatcher: Dispatcher,
        ) {
          for (delegate in eventListeners) {
            delegate.dispatcherQueueStart(call, dispatcher)
          }
        }
    
        override fun dispatcherQueueEnd(
          call: Call,
          dispatcher: Dispatcher,
        ) {
          for (delegate in eventListeners) {
            delegate.dispatcherQueueEnd(call, dispatcher)
          }
        }
    
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Tue Oct 07 21:03:04 UTC 2025
    - 24.9K bytes
    - Viewed (0)
  8. mockwebserver/README.md

    ```
    
    #### Dispatcher
    
    By default MockWebServer uses a queue to specify a series of responses. Use a
    Dispatcher (`import okhttp3.mockwebserver.Dispatcher`) to handle requests using another policy. One natural policy is to
    dispatch on the request path.
    You can, for example, filter the request instead of using `server.enqueue()`.
    
    ### Java
    ```java
    final Dispatcher dispatcher = new Dispatcher() {
    
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Thu Oct 30 21:39:59 UTC 2025
    - 8.1K bytes
    - Viewed (0)
  9. okhttp-testing-support/src/main/kotlin/okhttp3/ClientRuleEventListener.kt

      }
    
      override fun dispatcherQueueStart(
        call: Call,
        dispatcher: Dispatcher,
      ) {
        logWithTime("dispatcherQueueStart: queuedCallsCount=${dispatcher.queuedCallsCount()}")
      }
    
      override fun dispatcherQueueEnd(
        call: Call,
        dispatcher: Dispatcher,
      ) {
        logWithTime("dispatcherQueueEnd: queuedCallsCount=${dispatcher.queuedCallsCount()}")
      }
    
      override fun proxySelectStart(
        call: Call,
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Tue Oct 07 21:03:04 UTC 2025
    - 5.4K bytes
    - Viewed (0)
  10. okhttp/src/commonJvmAndroid/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))
      }
    
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Wed Nov 05 18:28:35 UTC 2025
    - 19.7K bytes
    - Viewed (0)
Back to top