yield(with:)
Resume the task awaiting the next iteration point by having it return normally from its suspension point with a given result’s success value.
Declaration
@discardableResult func yield(with result: sending Result<Element, Never>) -> AsyncStream<Element>.Continuation.YieldResultParameters
- result:
A result to yield from the continuation.
Return Value
A YieldResult that indicates the success or failure of the yield operation.
Discussion
If nothing is awaiting the next value, the method attempts to buffer the result’s element.
If you call this method repeatedly, each call returns immediately, without blocking for any awaiting consumption from the iteration.