the documentation for the AsyncIterator
s of AsyncStream
and AsyncThrowingStream
both include the following form of admonition (emphasis mine):
This type doesn’t conform to
Sendable
. Don’t use it from multiple concurrent contexts. It is a programmer error to invokenext()
from a concurrent context that contends with another such call, which results in a call tofatalError()
.
however, only one of these two types (AsyncThrowingStream
) currently implements the alluded-to runtime error if such a state is detected.
this difference appears incidental, and it would benefit developers to have both behavioral consistency across the throwing and non-throwing stream variants, as well as accurate documentation.
the removal of the runtime error appears to have been introduced in this PR, but it is unclear if it was intentional (i would guess not). according to github, this means it first shipped in Swift 5.7.
addressing this would presumably be quite straightforward (just need to revert a single line), but it's unclear to me what the actual process for realizing that is (open a PR? file a radar? evolution proposal?). so i ask – how can such a change be made?