Commit 567db01
authored
feat(pool): add a Negotiate pooling service (#228)
Creates a `Negotiate` type that uses an inner make-service, inspects the result, and then either returns an upgraded service, or fallback, depending on the negotiated. This is somewhat like a `Router`, but instead of routing on the request, it's routing on the response. It's an advanced form of an `Either`. The original use case is that of a connector that can sends ALPN to a destination, and can either comeback with HTTP/2 negotiated, or fallback to HTTP/1.
Closes hyperium/hyper#39551 parent c4cf24d commit 567db01
3 files changed
+642
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
79 | | - | |
| 80 | + | |
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
0 commit comments