Open
Description
Description
There's a discrepancy in the AsyncStream
APIs:
AsyncStream
has aninit(unfolding:onCancel:)
initializer- The
onCancel
parameter is optional because it has a default argument= nil
.
- The
AsyncThrowingStream
only hasinit(unfolding:)
without theonCancel
parameter.
The proposal SE-0314: AsyncStream and AsyncThrowingStream proposes the init(unfolding:onCancel:)
variant for both stream types, so not having it on AsyncThrowingStream
looks like an oversight.
Forum discussion: https://forums.swift.org/t/asyncthrowingstream-init-unfolding-has-no-oncancel-parameter/76386
Reproduction
n/a
Expected behavior
n/a
Environment
Swift 6.0. I checked the API docs at https://developer.apple.com/documentation/swift/asyncthrowingstream/ on 2024-12-05.
Additional information
No response