Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for runTask (0.32 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-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)
  3. 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