- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 80 for Dispatcher (0.05 sec)
-
mockwebserver/README.md
``` #### Dispatcher By default MockWebServer uses a queue to specify a series of responses. Use a Dispatcher (`import okhttp3.mockwebserver.Dispatcher`) to handle requests using another policy. One natural policy is to dispatch on the request path. You can, for example, filter the request instead of using `server.enqueue()`. ### Java ```java final Dispatcher dispatcher = new Dispatcher() {
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Thu Oct 30 21:39:59 UTC 2025 - 8.1K bytes - Viewed (0) -
okhttp-testing-support/src/main/kotlin/okhttp3/ClientRuleEventListener.kt
} override fun dispatcherQueueStart( call: Call, dispatcher: Dispatcher, ) { logWithTime("dispatcherQueueStart: queuedCallsCount=${dispatcher.queuedCallsCount()}") } override fun dispatcherQueueEnd( call: Call, dispatcher: Dispatcher, ) { logWithTime("dispatcherQueueEnd: queuedCallsCount=${dispatcher.queuedCallsCount()}") } override fun proxySelectStart( call: Call,
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Tue Oct 07 21:03:04 UTC 2025 - 5.4K bytes - Viewed (0) -
mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/MockWebServer.kt
var bodyLimit: Long by delegate::bodyLimit var serverSocketFactory: ServerSocketFactory? by delegate::serverSocketFactory var dispatcher: Dispatcher = QueueDispatcher() set(value) { field = value delegate.dispatcher = value.wrap() } val port: Int get() { before() // This implicitly starts the delegate. return delegate.port }
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Wed Jun 18 00:19:42 UTC 2025 - 4.6K bytes - Viewed (0) -
samples/static-server/src/main/java/okhttp3/sample/SampleServer.java
import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManagerFactory; import okhttp3.mockwebserver.Dispatcher; import okhttp3.mockwebserver.MockResponse; import okhttp3.mockwebserver.MockWebServer; import okhttp3.mockwebserver.RecordedRequest; import okio.Buffer; import okio.Okio; public class SampleServer extends Dispatcher { private final SSLContext sslContext; private final String root; private final int port;Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Wed Jan 02 02:50:44 UTC 2019 - 4.7K bytes - Viewed (0) -
mockwebserver/api/mockwebserver3.api
public abstract class mockwebserver3/Dispatcher : java/io/Closeable { public fun <init> ()V public fun close ()V public abstract fun dispatch (Lmockwebserver3/RecordedRequest;)Lmockwebserver3/MockResponse; public fun peek ()Lmockwebserver3/MockResponse; } public final class mockwebserver3/MockResponse { public fun <init> (ILokhttp3/Headers;Ljava/lang/String;)VRegistered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Fri Jun 20 11:46:46 UTC 2025 - 11.8K bytes - Viewed (0) -
okhttp-coroutines/README.md
```kotlin val call = client.newCall(request) call.executeAsync().use { response -> withContext(Dispatchers.IO) { println(response.body?.string()) } } ``` This is implemented using `suspendCancellableCoroutine` but uses the standard Dispatcher in OkHttp. This means that by default Kotlin's Dispatchers are not used. Cancellation if implemented sensibly in both directions.
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Thu Nov 09 15:47:27 UTC 2023 - 609 bytes - Viewed (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/connection/RealCall.kt
callStart() try { client.dispatcher.executed(this) return getResponseWithInterceptorChain() } finally { client.dispatcher.finished(this) } } override fun enqueue(responseCallback: Callback) { check(executed.compareAndSet(false, true)) { "Already Executed" } callStart() client.dispatcher.enqueue(AsyncCall(responseCallback)) }
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Wed Nov 05 18:28:35 UTC 2025 - 19.7K bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/okhttp3/internal/http2/HttpOverHttp2Test.kt
CountDownLatch(0), ) val dispatcher = RespondAfterCancelDispatcher(responseDequeuedLatches, requestCanceledLatches) dispatcher.enqueue( MockResponse .Builder() .bodyDelay(10, TimeUnit.SECONDS) .body("abc") .build(), ) dispatcher.enqueue( MockResponse(body = "def"), ) server.dispatcher = dispatcher client = client
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Sat Nov 01 12:18:11 UTC 2025 - 67.4K bytes - Viewed (0) -
samples/slack/src/main/java/okhttp3/slack/OAuthSessionFactory.java
package okhttp3.slack; import java.io.Closeable; import java.io.IOException; import java.security.SecureRandom; import java.util.LinkedHashMap; import java.util.Map; import okhttp3.HttpUrl; import okhttp3.mockwebserver.Dispatcher; import okhttp3.mockwebserver.MockResponse; import okhttp3.mockwebserver.MockWebServer; import okhttp3.mockwebserver.RecordedRequest; import okio.ByteString; /**
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Thu Aug 12 07:26:27 UTC 2021 - 3.8K bytes - Viewed (1) -
okhttp-testing-support/src/main/kotlin/okhttp3/CallEvent.kt
data class DispatcherQueueStart( override val timestampNs: Long, override val call: Call, val dispatcher: Dispatcher, ) : CallEvent() data class DispatcherQueueEnd( override val timestampNs: Long, override val call: Call, val dispatcher: Dispatcher, ) : CallEvent() { override fun closes(event: CallEvent): Boolean = event is DispatcherQueueStart && call == event.call }
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Mon Oct 06 13:40:20 UTC 2025 - 7.4K bytes - Viewed (0)