Last active
June 2, 2016 05:03
-
-
Save bexp/857f067b5a6676af3baafe4ff17afb60 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Dispatcher.java | |
/** | |
* Policy on when async requests are executed. | |
* | |
* <p>Each dispatcher uses an {@link ExecutorService} to run calls internally. If you supply your | |
* own executor, it should be able to run {@linkplain #getMaxRequests the configured maximum} number | |
* of calls concurrently. | |
*/ | |
public final class Dispatcher { | |
private int maxRequests = 64; | |
private int maxRequestsPerHost = 5; | |
... | |
//OkHttpClient.java | |
public Builder() { | |
dispatcher = new Dispatcher(); | |
protocols = DEFAULT_PROTOCOLS; | |
connectionSpecs = DEFAULT_CONNECTION_SPECS; | |
proxySelector = ProxySelector.getDefault(); | |
cookieJar = CookieJar.NO_COOKIES; | |
socketFactory = SocketFactory.getDefault(); | |
hostnameVerifier = OkHostnameVerifier.INSTANCE; | |
certificatePinner = CertificatePinner.DEFAULT; | |
proxyAuthenticator = Authenticator.NONE; | |
authenticator = Authenticator.NONE; | |
connectionPool = new ConnectionPool(); | |
dns = Dns.SYSTEM; | |
followSslRedirects = true; | |
followRedirects = true; | |
retryOnConnectionFailure = true; | |
connectTimeout = 10_000; | |
readTimeout = 10_000; | |
writeTimeout = 10_000; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment