Commit 9229842
authored
Replace AsyncBackpressuredStream with updated implementation (#29)
### Motivation
As a follow up to #27, we noted it would be good to align on the latest
draft implementation of SE-0406 (AsyncStream with backpressure) to both
pickup the latest improvements in performance and correctness, and to
minimise the churn if/when this lands in the standard library or
standalone package.
### Modifications
In order to simplify reviewing the following modifications have been
made in independent commits:
* `Add updated SE-0406 implementation as BufferedStream, incl. tests`:
Skim over this—it's vendored in wholesale.
* `Port the custom watermark support to BufferedStream`: Skim over
this—it's a 1:1 port of the logic that was added to
`AsyncBackpressuredStream`.
* `Switch from AsyncBackpressuredStream to BufferedStream in delegate`:
Review this—it's a minimal change.
* `Remove AsyncBackpressuredStream and its vendored locks`: Skim over
this—it's removing the old implementation.
### Result
No functional change, but the internal async sequence we're using should
be more robust, performant, and more likely to match a future standard
library type.
### Test Plan
- The new vendored `BufferedStream` actually comes with a much greater
number of vendored tests than the previous revision.
- Also ported the tests from this repo for the custom watermark logic.
- All our URLSessionTransport-specific tests continue to pass.
---------
Signed-off-by: Si Beaumont <[email protected]>1 parent 8c84285 commit 9229842
File tree
8 files changed
+3451
-1975
lines changed- Sources/OpenAPIURLSession
- AsyncBackpressuredStream
- BufferedStream
- URLSessionBidirectionalStreaming
- Tests/OpenAPIURLSessionTests
- AsyncBackpressuredStreamTests
- BufferedStreamTests
8 files changed
+3451
-1975
lines changedLines changed: 0 additions & 1384 deletions
This file was deleted.
Lines changed: 0 additions & 213 deletions
This file was deleted.
0 commit comments