InetSocketAddress's constructor will try to resolve the host to an IP address. As a result, if you're on a network that happens to have a resolvable `myproxy` host, this test would fail -- and as it turns out, my home network does.
Instead, use InetSocketAddress.createUnresolved().
We've got a race where we'll start a thread when we need
one, even if we've already started a thread. This changes
TaskRunner's behavior to never add a thread if we're
still waiting for a recently-added one to start running.
This is intended to reduce the number of threads contenting
for the TaskRunner lock as reported in this issue:
https://github.com/square/okhttp/issues/8388
* Move coroutines extensions to okhttp3.coroutines
This has the side-effect of fixing our packaging of this module.
Previously the okhttp-coroutines.jar contained the code from the
:okhttp artifact, not the :okhttp-coroutines artifact. I suspect
something in one of our build steps is incorrectly using the
package names (only) as a cache key, and it should instead be
using the package contents.
* apiDump
* Fix public APIs for kotlin.time.Duration
Use this as our preferred API for accepting a duration in
OkHttpClient and CacheControl.
Also hide these functions from the Java API.
* Code review feedback
* Spotless
* apiDump
1. The first test just needed to be uncommented now that https://github.com/square/okhttp/pull/8348 is merged
2. A second test was added to exercise http2-specific functionality
This is different from the production thread factory:
- No daemon threads in tests. We don't need 'em.
- Threads are numbered in tests. We do need that.
* Redo TaskFaker's internal queue
Previously this used locks to stop threads from executing. Now
it uses a custom 'yield' function to accomplish a similar purpose.
The main benefit of the new approach is we're no longer subject
to unspecified lock release order - we maintain our own queue
and get true deterministic order of execution.
* Fix interruption
* Fixup tests
* Spotless
* Use an enum rather than two booleans
* Change parameter order for Cache constructor
Put FileSystem before Path, as is convention.
Also put this new constructor in the public API.
* apiDump
* Track the change in RunSurvey
* Track signature change
* Don't leak response bodies in executeAsync
Also make callers opt in to an unstable coroutines API. If the resource
cleanup coroutines API changes, we'll have to change this API.
Remove the OkHttp experimental API. This is a good enough API as far
as OkHttp is concerned.
* Spotless