Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 52 for dispatcher (0.78 sec)

  1. 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)
  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/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)
  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-testing-support/src/main/kotlin/okhttp3/OkHttpClientTestRule.kt

            .connectionPool(
              buildConnectionPool(
                connectionListener = connectionListener,
                taskRunner = taskRunner,
              ),
            )
            .dispatcher(Dispatcher(backend.executor))
            .taskRunnerInternal(taskRunner)
        } else {
          OkHttpClient.Builder()
            .connectionPool(ConnectionPool(connectionListener = connectionListener))
        }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/OkHttpClientTest.kt

        val a = client.newBuilder().build()
        assertThat(a.dispatcher).isNotNull()
        assertThat(a.connectionPool).isNotNull()
        assertThat(a.sslSocketFactory).isNotNull()
        assertThat(a.x509TrustManager).isNotNull()
    
        // Multiple clients share the instances.
        val b = client.newBuilder().build()
        assertThat(b.dispatcher).isSameAs(a.dispatcher)
        assertThat(b.connectionPool).isSameAs(a.connectionPool)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Mar 31 17:16:15 GMT 2024
    - 13.2K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/KotlinDeprecationErrorTest.kt

        val headers: Headers? = part.headers()
        val body: RequestBody = part.body()
      }
    
      @Test @Disabled
      fun okHttpClient() {
        val client = OkHttpClient()
        val dispatcher: Dispatcher = client.dispatcher()
        val proxy: Proxy? = client.proxy()
        val protocols: List<Protocol> = client.protocols()
        val connectionSpecs: List<ConnectionSpec> = client.connectionSpecs()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 13.3K bytes
    - Viewed (0)
  8. 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)
  9. mockwebserver/src/test/java/mockwebserver3/MockWebServerTest.kt

        val connection = server.url("/").toUrl().openConnection() as HttpURLConnection
        connection.readTimeout = 500
        try {
          connection.responseCode
          fail<Unit>()
        } catch (expected: SocketTimeoutException) {
          // Expected.
        }
    
        // Shutting down the server should unblock the dispatcher.
        server.shutdown()
      }
    
      @Test
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 23.5K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/InterceptorTest.kt

        val boom = RuntimeException("boom!")
        addInterceptor(network) { chain: Interceptor.Chain? -> throw boom }
        val executor = ExceptionCatchingExecutor()
        client =
          client.newBuilder()
            .dispatcher(Dispatcher(executor))
            .build()
        val request =
          Request.Builder()
            .url(server.url("/"))
            .build()
        val call = client.newCall(request)
        call.enqueue(callback)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Jan 14 10:20:09 GMT 2024
    - 27.8K bytes
    - Viewed (0)
Back to top