Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 41 for queued (0.16 sec)

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

        ready.await()
        assertThat(dispatcher.runningCallsCount()).isEqualTo(2)
        assertThat(dispatcher.queuedCallsCount()).isEqualTo(0)
        assertThat(dispatcher.runningCalls())
          .containsExactlyInAnyOrder(a1, a2)
        assertThat(dispatcher.queuedCalls()).isEmpty()
    
        // Cancel some calls. That doesn't impact running or queued.
        a2.cancel()
        a3.cancel()
    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/README.md

    assertEquals("application/json; charset=utf-8", request.getHeader("Content-Type"));
    assertEquals("{}", request.getBody().readUtf8());
    ```
    
    #### 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.
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Dec 17 15:34:10 GMT 2023
    - 5K bytes
    - Viewed (1)
  3. okhttp/src/test/java/okhttp3/ServerTruncatesRequestTest.kt

        }
    
        assertThat(server.requestCount).isEqualTo(0)
    
        // Confirm that the connection pool was not corrupted by making another call. This doesn't use
        // makeSimpleCall() because it uses the MockResponse enqueued above.
        val callB = client.newCall(Request(server.url("/")))
        callB.execute().use { response ->
          assertThat(response.body.string()).isEqualTo("abc")
        }
      }
    
      private fun makeSimpleCall() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.5K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/internal/connection/RealCall.kt

            }
          }
        }
      }
    
      internal class CallReference(
        referent: RealCall,
        /**
         * Captures the stack trace at the time the Call is executed or enqueued. This is helpful for
         * identifying the origin of connection leaks.
         */
        val callStackTrace: Any?,
      ) : WeakReference<RealCall>(referent)
    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. mockwebserver/src/main/kotlin/mockwebserver3/QueueDispatcher.kt

          logger.info("served $requestLine")
          return MockResponse(code = HttpURLConnection.HTTP_NOT_FOUND)
        }
    
        if (failFastResponse != null && responseQueue.peek() == null) {
          // Fail fast if there's no response queued up.
          return failFastResponse!!
        }
    
        val result = responseQueue.take()
    
        // If take() returned because we're shutting down, then enqueue another dead letter so that any
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 23 14:31:42 GMT 2024
    - 3K bytes
    - Viewed (0)
  6. okhttp/src/main/kotlin/okhttp3/internal/concurrent/TaskQueue.kt

    import okhttp3.internal.assertNotHeld
    import okhttp3.internal.okHttpName
    
    /**
     * A set of tasks that are executed in sequential order.
     *
     * Work within queues is not concurrent. This is equivalent to each queue having a dedicated thread
     * for its work; in practice a set of queues may share a set of threads to save resources.
     */
    class TaskQueue internal constructor(
      internal val taskRunner: TaskRunner,
      internal val name: String,
    ) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.5K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/internal/concurrent/Task.kt

      /** Returns the delay in nanoseconds until the next execution, or -1L to not reschedule. */
      abstract fun runOnce(): Long
    
      internal fun initQueue(queue: TaskQueue) {
        if (this.queue === queue) return
    
        check(this.queue === null) { "task is in multiple queues" }
        this.queue = queue
      }
    
      override fun toString(): String = name
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.4K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/internal/concurrent/TaskRunner.kt

        delayNanos: Long,
      ) {
        lock.assertHeld()
    
        val queue = task.queue!!
        check(queue.activeTask === task)
    
        val cancelActiveTask = queue.cancelActiveTask
        queue.cancelActiveTask = false
        queue.activeTask = null
        busyQueues.remove(queue)
    
        if (delayNanos != -1L && !cancelActiveTask && !queue.shutdown) {
          queue.scheduleAndDecide(task, delayNanos, recurrence = true)
        }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 29 00:33:04 GMT 2024
    - 10.6K bytes
    - Viewed (0)
  9. okhttp/src/main/kotlin/okhttp3/internal/http/HttpHeaders.kt

    }
    
    private fun Buffer.startsWith(prefix: Byte): Boolean = !exhausted() && this[0] == prefix
    
    /**
     * Reads a double-quoted string, unescaping quoted pairs like `\"` to the 2nd character in each
     * sequence. Returns the unescaped string, or null if the buffer isn't prefixed with a
     * double-quoted string.
     */
    @Throws(EOFException::class)
    private fun Buffer.readQuotedString(): String? {
      require(readByte() == '\"'.code.toByte())
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  10. okhttp/src/main/kotlin/okhttp3/internal/connection/FastFallbackExchangeFinder.kt

        }
    
        throw firstException!!
      }
    
      /**
       * Returns non-null if we don't need to wait for the launched result. In such cases, this result
       * must be processed before whatever is waiting in the queue because we may have already acquired
       * its connection.
       */
      private fun launchTcpConnect(): ConnectResult? {
        val plan =
          when {
            routePlanner.hasNext() -> {
              try {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.8K bytes
    - Viewed (0)
Back to top