@@ -15,7 +15,7 @@ import Swift
15
15
/// An ordered, asynchronously generated sequence of elements.
16
16
///
17
17
/// AsyncStream is an interface type to adapt from code producing values to an
18
- /// asynchronous context iterating them. This is itended to be used to allow
18
+ /// asynchronous context iterating them. This is intended to be used to allow
19
19
/// callback or delegation based APIs to participate with async/await.
20
20
///
21
21
/// When values are produced from a non async/await source there is a
@@ -57,13 +57,13 @@ public struct AsyncStream<Element> {
57
57
let storage : _Storage
58
58
59
59
/// Resume the task awaiting the next iteration point by having it return
60
- /// nomally from its suspension point or buffer the value if no awaiting
60
+ /// normally from its suspension point or buffer the value if no awaiting
61
61
/// next iteration is active.
62
62
///
63
63
/// - Parameter value: The value to yield from the continuation.
64
64
///
65
65
/// This can be called more than once and returns to the caller immediately
66
- /// without blocking for any awaiting consuption from the iteration.
66
+ /// without blocking for any awaiting consumption from the iteration.
67
67
public func yield( _ value: __owned Element) {
68
68
storage. yield ( value)
69
69
}
@@ -86,7 +86,7 @@ public struct AsyncStream<Element> {
86
86
/// is disposed of after any terminal state is reached.
87
87
///
88
88
/// Cancelling an active iteration will first invoke the onTermination callback
89
- /// and then resume yeilding nil. This means that any cleanup state can be
89
+ /// and then resume yielding nil. This means that any cleanup state can be
90
90
/// emitted accordingly in the cancellation handler
91
91
public var onTermination : ( @Sendable ( Termination ) -> Void ) ? {
92
92
get {
@@ -108,7 +108,7 @@ public struct AsyncStream<Element> {
108
108
/// - Parameter build: The work associated with yielding values to the AsyncStream.
109
109
///
110
110
/// The maximum number of pending elements limited by dropping the oldest
111
- /// value when a new value comes in if the buffer would excede the limit
111
+ /// value when a new value comes in if the buffer would exceed the limit
112
112
/// placed upon it. By default this limit is unlimited.
113
113
///
114
114
/// The build closure passes in a Continuation which can be used in
@@ -130,7 +130,7 @@ public struct AsyncStream<Element> {
130
130
extension AsyncStream : AsyncSequence {
131
131
/// The asynchronous iterator for iterating a AsyncStream.
132
132
///
133
- /// This type is specificially not Sendable. It is not intended to be used
133
+ /// This type is specifically not Sendable. It is not intended to be used
134
134
/// from multiple concurrent contexts. Any such case that next is invoked
135
135
/// concurrently and contends with another call to next is a programmer error
136
136
/// and will fatalError.
@@ -145,7 +145,7 @@ extension AsyncStream: AsyncSequence {
145
145
///
146
146
/// If the task this iterator is running in is canceled while next is
147
147
/// awaiting a value, this will terminate the AsyncStream and next may return nil
148
- /// immediately (or will return nil on subseuqent calls)
148
+ /// immediately (or will return nil on subsequent calls)
149
149
public mutating func next( ) async -> Element ? {
150
150
await produce ( )
151
151
}
@@ -166,7 +166,7 @@ extension AsyncStream.Continuation {
166
166
/// - Parameter result: A result to yield from the continuation.
167
167
///
168
168
/// This can be called more than once and returns to the caller immediately
169
- /// without blocking for any awaiting consuption from the iteration.
169
+ /// without blocking for any awaiting consumption from the iteration.
170
170
public func yield(
171
171
with result: Result < Element , Never >
172
172
) {
@@ -181,7 +181,7 @@ extension AsyncStream.Continuation {
181
181
/// next iteration is active where the `Element` is `Void`.
182
182
///
183
183
/// This can be called more than once and returns to the caller immediately
184
- /// without blocking for any awaiting consuption from the iteration.
184
+ /// without blocking for any awaiting consumption from the iteration.
185
185
public func yield( ) where Element == Void {
186
186
storage. yield ( ( ) )
187
187
}
0 commit comments