yield(contentsOf:)
Yields a sequence of new elements to the NIOAsyncWriter
.
- iOS
- 13+
- macOS
- 10.15+
- tvOS
- 13+
- watchOS
- 6+
func yield<S>(contentsOf sequence: S) async throws where S : Sequence, Delegate.Element == S.Element
Parameters
- sequence
The sequence to yield.
If the NIOAsyncWriter
is writable the sequence will get forwarded to the NIOAsyncWriterSinkDelegate
immediately. Otherwise, the sequence will be buffered and the call to yield(contentsOf:)
will get suspended until the NIOAsyncWriter
becomes writable again.
If the calling Task
gets cancelled at any point the call to yield(contentsOf:)
will be resumed. Consequently, the provided elements will not be yielded.
This can be called more than once and from multiple Task
s at the same time.