Skip to content

Commit 9229842

Browse files
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

8 files changed

+3451
-1975
lines changed

Sources/OpenAPIURLSession/AsyncBackpressuredStream/AsyncBackpressuredStream.swift

-1,384
This file was deleted.

Sources/OpenAPIURLSession/AsyncBackpressuredStream/NIOLock.swift

-213
This file was deleted.

0 commit comments

Comments
 (0)