Instance Methodswift-nio 2.72.0NIOCore
yield(_:)
Yields a new elements to the NIOAsyncSequenceProducer
.
- iOS
- 13+
- macOS
- 10.15+
- tvOS
- 13+
- watchOS
- 6+
func yield(_ element: Element) -> YieldResult
Parameters
- element
The element to yield.
Returns
A YieldResult
that indicates if the yield was successful and if more elements should be produced.
If there is an AsyncIterator
awaiting the next element, it will get resumed right away. Otherwise, the element will get buffered.
If the NIOAsyncSequenceProducer
is terminated this will drop the elements and return dropped
.
This can be called more than once and returns to the caller immediately without blocking for any awaiting consumption from the iteration.
Other members in extension
Types
enum YieldResult
The result of a call to
yield(_:)
.
Instance members
func finish(
) Finishes the sequence.
func yield<S>(contentsOf: S
) -> YieldResult Yields a sequence of new elements to the
NIOAsyncSequenceProducer
.