Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <beaumont@apple.com>
- Loading branch information