Commit 3e14630
committed
Refactor legacy client to be independent of tokio
This patch decouples the functionality of `client::legacy` from tokio,
by lifting up a `Client`, `HttpConnection`, and `Resolver` into the
`client` module. For backwards compatibility, it reimplements
`client::legacy` to be based off of the new code.
As best as I can tell it should be backwards compatible, and passes all
the tests.
There's a couple of areas where I'm not sure if we got quite the right API:
* Capturing connection info - This adds a helper closure you can call to
get it, which is then used by he legacy client to send the info to the
tokio watch.
* This extracts the pool info, but there's been a long standing plan to
replace it with something better. I'm not sure what that would look
like though.
* I set up the legacy Client and HttpConnector to wrap the new generic
APIs. That adds a bit of code duplication, but as far as I can tell we
can't use a type alias due to the `new` method.1 parent 4595a08 commit 3e14630
File tree
26 files changed
+4943
-4477
lines changed- src
- client
- connect
- dns
- http
- tcp
- legacy
- connect
- pool
- common
- rt
- server/conn/auto
- service
- tests
26 files changed
+4943
-4477
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
77 | | - | |
78 | | - | |
79 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| |||
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
92 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
| |||
0 commit comments