Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for runTask (0.19 sec)

  1. okhttp/src/main/kotlin/okhttp3/internal/concurrent/TaskRunner.kt

                  }
                  awaitTaskToRun()
                } ?: return
    
              logger.logElapsed(task, task.queue!!) {
                var completedNormally = false
                try {
                  runTask(task)
                  completedNormally = true
                } finally {
                  // If the task is crashing start another thread to service the queues.
                  if (!completedNormally) {
                    lock.withLock {
    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)
  2. okhttp/src/test/java/okhttp3/internal/ws/RealWebSocketTest.kt

        taskFaker.runTasks()
        client.listener.assertFailure(IOException::class.java, "source is closed")
        assertThat(client.webSocket!!.send("Hello!")).isFalse()
      }
    
      @Test
      fun socketClosedDuringMessageKillsWebSocket() {
        client2Server.source.close()
        assertThat(client.webSocket!!.send("Hello!")).isTrue()
        taskFaker.runTasks()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 01:59:58 GMT 2024
    - 18.5K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/internal/connection/ConnectionPoolTest.kt

        address: Address,
        policy: ConnectionPool.AddressPolicy,
      ) {
        pool.setPolicy(address, policy)
        taskFaker.runTasks()
      }
    
      private fun evictAllConnections(pool: RealConnectionPool) {
        pool.evictAll()
        assertThat(pool.connectionCount()).isEqualTo(0)
        taskFaker.runTasks()
      }
    
      private fun forceConnectionsToExpire(
        pool: RealConnectionPool,
        expireTime: Long,
      ) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 24 04:40:49 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  4. okhttp-testing-support/src/main/kotlin/okhttp3/internal/concurrent/TaskFaker.kt

     * deterministic.
     *
     * This class ensures that at most one thread is running at a time. This is initially the JUnit test
     * thread, which yields its execution privilege while calling [runTasks], [runNextTask], or
     * [advanceUntil]. These functions don't return until the task threads are all idle.
     *
     * Task threads release their execution privilege in these ways:
     *
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 29 00:33:04 GMT 2024
    - 12.6K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/internal/connection/FastFallbackExchangeFinderTest.kt

        plan0.connectState = TLS_CONNECTED
    
        taskRunner.newQueue().execute("connect") {
          val result0 = finder.find()
          assertThat(result0).isEqualTo(plan0.connection)
        }
    
        taskFaker.runTasks()
        assertEvents(
          "take plan 0",
        )
    
        taskFaker.assertNoMoreTasks()
      }
    
      @Test
      fun takeConnectingConnection() {
        val plan0 = routePlanner.addPlan()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 24 04:40:49 GMT 2024
    - 20.9K bytes
    - Viewed (0)
  6. okhttp/src/main/kotlin/okhttp3/internal/ws/WebSocketReader.kt

          readControlFrame()
        }
      }
    
      /**
       * Reads a message body into across one or more frames. Control frames that occur between
       * fragments will be processed. If the message payload is masked this will unmask as it's being
       * processed.
       */
      @Throws(IOException::class)
      private fun readMessage() {
        while (true) {
          if (closed) throw IOException("closed")
    
          if (frameLength > 0L) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/internal/concurrent/TaskRunnerTest.kt

        blueQueue.execute("blue task", 200.µs) {
          log += "blue:run@${taskFaker.nanoTime}"
        }
        assertThat(taskFaker.executeCallCount).isEqualTo(1)
    
        // Nothing to do.
        taskFaker.runTasks()
        assertThat(log).isEmpty()
    
        // At 100.µs, the coordinator runs the red task and starts a thread for the new coordinator.
        taskFaker.advanceUntil(100.µs)
        assertThat(log).containsExactly("red:run@100000")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 29 00:33:04 GMT 2024
    - 23K bytes
    - Viewed (0)
Back to top