Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 21 for Scheduler (0.33 sec)

  1. mockwebserver/README.md

    ```java
    public void test() throws Exception {
      // Create a MockWebServer. These are lean enough that you can create a new
      // instance for every unit test.
      MockWebServer server = new MockWebServer();
    
      // Schedule some responses.
      server.enqueue(new MockResponse().setBody("hello, world!"));
      server.enqueue(new MockResponse().setBody("sup, bra?"));
      server.enqueue(new MockResponse().setBody("yo dog"));
    
      // Start the server.
    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)
  2. okhttp/src/main/kotlin/okhttp3/internal/concurrent/TaskQueue.kt

        // If the task is already scheduled, take the earlier of the two times.
        val existingIndex = futureTasks.indexOf(task)
        if (existingIndex != -1) {
          if (task.nextExecuteNanoTime <= executeNanoTime) {
            taskRunner.logger.taskLog(task, this) { "already scheduled" }
            return false
          }
          futureTasks.removeAt(existingIndex) // Already scheduled later: reschedule below!
        }
    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)
  3. okhttp/src/main/kotlin/okhttp3/internal/concurrent/Task.kt

     * ----------
     *
     * Tasks control their recurrence schedule. The [runOnce] function returns -1L to signify that the
     * task should not be executed again. Otherwise it returns a delay until the next execution.
     *
     * A task has at most one next execution. If the same task instance is scheduled multiple times, the
     * earliest one wins. This applies to both executions scheduled with [TaskRunner.Queue.schedule] and
     * those implied by the returned execution delay.
    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)
  4. okhttp/src/main/kotlin/okhttp3/internal/connection/FastFallbackExchangeFinder.kt

        if (plan is FailedPlan) return plan.result
    
        // Connect TCP asynchronously.
        tcpConnectsInFlight += plan
        val taskName = "$okHttpName connect ${routePlanner.address.url.redact()}"
        taskRunner.newQueue().schedule(
          object : Task(taskName) {
            override fun runOnce(): Long {
              val connectResult =
                try {
                  plan.connectTcp()
                } catch (e: Throwable) {
    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)
  5. okhttp/src/test/java/okhttp3/internal/concurrent/TaskRunnerRealBackendTest.kt

      }
    
      @Test fun taskFailsWithUncheckedException() {
        queue.schedule("task", TimeUnit.MILLISECONDS.toNanos(100)) {
          log.put("failing task running")
          throw RuntimeException("boom!")
        }
    
        queue.schedule("task", TimeUnit.MILLISECONDS.toNanos(200)) {
          log.put("normal task running")
          return@schedule -1L
        }
    
        queue.idleLatch().await(500, TimeUnit.MILLISECONDS)
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  6. docs/contribute/debug_logging.md

    ```
    [2020-01-01 00:00:00] Q10000 scheduled after   0 µs: OkHttp ConnectionPool
    [2020-01-01 00:00:00] Q10000 starting              : OkHttp ConnectionPool
    [2020-01-01 00:00:00] Q10000 run again after 300 s : OkHttp ConnectionPool
    [2020-01-01 00:00:00] Q10000 finished run in   1 ms: OkHttp ConnectionPool
    [2020-01-01 00:00:00] Q10001 scheduled after   0 µs: OkHttp squareup.com applyAndAckSettings
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 06 16:35:36 GMT 2022
    - 2.7K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/internal/concurrent/TaskRunner.kt

              } catch (_: InterruptedException) {
                // Will cause all tasks to exit unless more are scheduled!
                cancelAll()
              } finally {
                coordinatorWaiting = false
              }
            }
          }
        }
      }
    
      /** Start another thread, unless a new thread is already scheduled to start. */
      private fun startAnotherThread() {
        lock.assertHeld()
    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)
  8. okhttp-testing-support/src/main/kotlin/okhttp3/internal/concurrent/TaskFaker.kt

      private val tasksExecutor = Executors.newCachedThreadPool(threadFactory("TaskFaker"))
    
      /**
       * True if this task faker has ever had multiple tasks scheduled to run concurrently. Guarded by
       * [TaskRunner.lock].
       */
      var isParallel = false
    
      /** Number of calls to [TaskRunner.Backend.execute]. Guarded by [TaskRunner.lock]. */
      var executeCallCount = 0
    
    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)
  9. okhttp/src/main/kotlin/okhttp3/Call.kt

       *     remote server accepted the request before the failure.
       * @throws IllegalStateException when the call has already been executed.
       */
      @Throws(IOException::class)
      fun execute(): Response
    
      /**
       * Schedules the request to be executed at some point in the future.
       *
       * The [dispatcher][OkHttpClient.dispatcher] defines when the request will run: usually
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Dec 20 23:27:07 GMT 2023
    - 3.6K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/internal/ws/WebSocketHttpTest.kt

            .build(),
        )
        val webSocket = newWebSocket()
        clientListener.assertOpen()
        val server = serverListener.assertOpen()
    
        // Initiate a close on the client, which will schedule a hard cancel in 500 ms.
        val closeAtNanos = System.nanoTime()
        webSocket.close(1000, "goodbye", 500L)
        serverListener.assertClosing(1000, "goodbye")
    
        // Confirm that the hard cancel occurred after 500 ms.
    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)
Back to top