Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 24 for Runnable (0.19 sec)

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

      private val busyQueues = mutableListOf<TaskQueue>()
    
      /** Queues not in [busyQueues] that have non-empty [TaskQueue.futureTasks]. */
      private val readyQueues = mutableListOf<TaskQueue>()
    
      private val runnable: Runnable =
        object : Runnable {
          override fun run() {
            var incrementedRunCallCount = false
            while (true) {
              val task =
                ******@****.***ck {
    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/main/kotlin/okhttp3/internal/connection/RealCall.kt

            " to " + redactedUrl()
        )
      }
    
      internal fun redactedUrl(): String = originalRequest.url.redact()
    
      inner class AsyncCall(
        private val responseCallback: Callback,
      ) : Runnable {
        @Volatile var callsPerHost = AtomicInteger(0)
          private set
    
        fun reuseCallsPerHostFrom(other: AsyncCall) {
          this.callsPerHost = other.callsPerHost
        }
    
        val host: String
    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)
  3. okhttp-testing-support/src/main/kotlin/okhttp3/internal/concurrent/TaskFaker.kt

        TaskRunner(
          object : TaskRunner.Backend {
            override fun execute(
              taskRunner: TaskRunner,
              runnable: Runnable,
            ) {
              taskRunner.assertThreadHoldsLock()
    
              val queuedTask = RunnableSerialTask(runnable)
              serialTaskQueue += queuedTask
              executeCallCount++
              isParallel = serialTaskQueue.size > 1
            }
    
    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)
  4. okhttp/src/test/java/okhttp3/RecordingExecutor.kt

      private val dispatcherTest: DispatcherTest,
    ) : AbstractExecutorService() {
      private var shutdown: Boolean = false
      private val calls = mutableListOf<RealCall.AsyncCall>()
    
      override fun execute(command: Runnable) {
        if (shutdown) throw RejectedExecutionException()
        calls.add(command as RealCall.AsyncCall)
      }
    
      fun assertJobs(vararg expectedUrls: String) {
        val actualUrls = calls.map { it.request.url.toString() }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/internal/concurrent/TaskRunnerRealBackendTest.kt

      private val loggingUncaughtExceptionHandler =
        UncaughtExceptionHandler { _, throwable ->
          log.put("uncaught exception: $throwable")
        }
    
      private val threadFactory =
        ThreadFactory { runnable ->
          Thread(runnable, "TaskRunnerRealBackendTest").apply {
            isDaemon = true
            uncaughtExceptionHandler = loggingUncaughtExceptionHandler
          }
        }
    
      private val backend = TaskRunner.RealBackend(threadFactory)
    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. okhttp/src/main/kotlin/okhttp3/internal/-UtilJvm.kt

    @JvmField
    internal val UTC: TimeZone = TimeZone.getTimeZone("GMT")!!
    
    internal fun threadFactory(
      name: String,
      daemon: Boolean,
    ): ThreadFactory =
      ThreadFactory { runnable ->
        Thread(runnable, name).apply {
          isDaemon = daemon
        }
      }
    
    internal fun HttpUrl.toHostHeader(includeDefaultPort: Boolean = false): String {
      val host =
        if (":" in host) {
          "[$host]"
        } else {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 09 12:33:05 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  7. okhttp-testing-support/src/main/kotlin/okhttp3/TestUtilJvm.kt

      }
    
      @JvmStatic
      fun threadFactory(name: String): ThreadFactory {
        return object : ThreadFactory {
          private var nextId = 1
    
          override fun newThread(runnable: Runnable): Thread {
            return Thread(runnable, "$name-${nextId++}")
          }
        }
      }
    }
    
    fun getEnv(name: String) = System.getenv(name)
    
    val SYSTEM_FILE_SYSTEM = FileSystem.SYSTEM
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 4.3K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/InterceptorTest.kt

        ThreadPoolExecutor(1, 1, 0, TimeUnit.SECONDS, SynchronousQueue()) {
        private val exceptions: BlockingQueue<Exception> = LinkedBlockingQueue()
    
        override fun execute(runnable: Runnable) {
          super.execute {
            try {
              runnable.run()
            } catch (e: Exception) {
              exceptions.add(e)
            }
          }
        }
    
        fun takeException(): Exception {
          return exceptions.take()
    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)
  9. okhttp/src/main/kotlin/okhttp3/Dispatcher.kt

       * This means that if you are doing synchronous calls the network layer will not truly be idle
       * until every returned [Response] has been closed.
       */
      var idleCallback: Runnable? = null
        get() = this.withLock { field }
        set(value) {
          this.withLock { field = value }
        }
    
      private var executorServiceOrNull: ExecutorService? = null
    
      @get:JvmName("executorService")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 9K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/internal/connection/ConnectionPoolTest.kt

      private val factory = routePlanner.factory
      private val taskFaker = routePlanner.taskFaker
      private val peer = MockHttp2Peer()
    
      /** The fake task runner prevents the cleanup runnable from being started.  */
      private val addressA = factory.newAddress("a")
      private val routeA1 = factory.newRoute(addressA)
      private val addressB = factory.newAddress("b")
      private val routeB1 = factory.newRoute(addressB)
    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)
Back to top