-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
ConcurrencуArea → standard library: The `Concurrency` module under the standard library umbrellaArea → standard library: The `Concurrency` module under the standard library umbrellabugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.concurrencyFeature: umbrella label for concurrency language featuresFeature: umbrella label for concurrency language featuresstandard libraryArea: Standard library umbrellaArea: Standard library umbrella
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
Metadata
Metadata
Assignees
Labels
ConcurrencуArea → standard library: The `Concurrency` module under the standard library umbrellaArea → standard library: The `Concurrency` module under the standard library umbrellabugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.concurrencyFeature: umbrella label for concurrency language featuresFeature: umbrella label for concurrency language featuresstandard libraryArea: Standard library umbrellaArea: Standard library umbrella