- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 13 for CancelCall (0.11 sec)
-
samples/guide/src/main/java/okhttp3/recipes/kt/CancelCall.kt
*/ package okhttp3.recipes.kt import java.io.IOException import java.util.concurrent.Executors import java.util.concurrent.TimeUnit import okhttp3.OkHttpClient import okhttp3.Request class CancelCall { private val executor = Executors.newScheduledThreadPool(1) private val client = OkHttpClient() fun run() { val request = Request .Builder()
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Wed Mar 19 19:25:20 UTC 2025 - 2K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/CancelCall.java
import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import okhttp3.Call; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; public class CancelCall { private final ScheduledExecutorService executor = Executors.newScheduledThreadPool(1); private final OkHttpClient client = new OkHttpClient(); public void run() throws Exception {
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Sat Jan 12 03:31:36 UTC 2019 - 2.1K bytes - Viewed (0) -
docs/recipes.md
[CancelCallJava]: https://github.com/square/okhttp/blob/master/samples/guide/src/main/java/okhttp3/recipes/CancelCall.java [CancelCallKotlin]: https://github.com/square/okhttp/blob/master/samples/guide/src/main/java/okhttp3/recipes/kt/CancelCall.kt [ConfigureTimeoutsJava]: https://github.com/square/okhttp/blob/master/samples/guide/src/main/java/okhttp3/recipes/ConfigureTimeouts.java
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Sat Aug 30 17:01:12 UTC 2025 - 47.8K bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/okhttp3/internal/concurrent/TaskRunnerTest.kt
blueQueue.execute("task", 100.µs) { error("expected to be canceled") } assertThat(taskFaker.executeCallCount).isEqualTo(1) redQueue.cancelAll() assertThat(taskFaker.executeCallCount).isEqualTo(1) blueQueue.cancelAll() assertThat(taskFaker.executeCallCount).isEqualTo(1) } @Test fun noMoreThanOneWorkerThreadWaitingToStartAtATime() {
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Wed Mar 19 19:25:20 UTC 2025 - 23K bytes - Viewed (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/connection/RealConnectionPool.kt
return if (connection.noNewExchanges || maxIdleConnections == 0) { connection.noNewExchanges = true connections.remove(connection) if (connections.isEmpty()) cleanupQueue.cancelAll() scheduleOpener(connection.route.address) true } else { scheduleCloser() false } } fun evictAll() { val i = connections.iterator()
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Tue Jun 03 17:10:08 UTC 2025 - 16.1K bytes - Viewed (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/concurrent/TaskRunner.kt
try { backend.coordinatorWait(this@TaskRunner, minDelayNanos) } 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. */
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Sat Aug 30 11:30:11 UTC 2025 - 10.4K bytes - Viewed (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/concurrent/TaskQueue.kt
* will not be made until any currently-executing task has completed. Tasks that return true will * be removed from the execution schedule. */ fun cancelAll() { taskRunner.assertLockNotHeld() taskRunner.withLock { if (cancelAllAndDecide()) { taskRunner.kickCoordinator(this) } } } fun shutdown() {
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Wed May 28 23:28:25 UTC 2025 - 7.3K bytes - Viewed (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/Dispatcher.kt
} /** * Cancel all calls currently enqueued or executing. Includes calls executed both * [synchronously][Call.execute] and [asynchronously][Call.enqueue]. */ @Synchronized fun cancelAll() { for (call in readyAsyncCalls) { call.call.cancel() } for (call in runningAsyncCalls) { call.call.cancel() } for (call in runningSyncCalls) { call.cancel()
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Wed May 28 23:28:25 UTC 2025 - 8.7K bytes - Viewed (0) -
okhttp-testing-support/src/main/kotlin/okhttp3/OkHttpClientTestRule.kt
val waitTime = (entryTime + 1_000_000_000L - System.nanoTime()) if (!queue.idleLatch().await(waitTime, TimeUnit.NANOSECONDS)) { TaskRunner.INSTANCE.withLock { TaskRunner.INSTANCE.cancelAll() } fail<Unit>("Queue still active after 1000 ms") } } } override fun beforeEach(context: ExtensionContext) { testName = context.displayName beforeEach()
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Fri May 30 21:28:20 UTC 2025 - 10.5K bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/okhttp3/KotlinSourceModernTest.kt
val runningCalls: List<Call> = dispatcher.runningCalls() val queuedCallsCount: Int = dispatcher.queuedCallsCount() val runningCallsCount: Int = dispatcher.runningCallsCount() dispatcher.cancelAll() } @Test fun dispatcherFromMockWebServer() { val dispatcher = object : okhttp3.mockwebserver.Dispatcher() { override fun dispatch(request: RecordedRequest): MockResponse = TODO()
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Sat Jun 21 20:36:35 UTC 2025 - 46.5K bytes - Viewed (0)