Instance Method インスタンスメソッド

yield()

Resume the task awaiting the next iteration point by having it return normally from its suspension point.

Declaration 宣言

@discardableResult func yield() -> AsyncStream<Element>.Continuation.YieldResult where Element == Void

Return Value 戻り値

A YieldResult that indicates the success or failure of the yield operation.

Discussion 解説

Use this method with AsyncStream instances whose Element type is Void. In this case, the yield() call unblocks the awaiting iteration; there is no value to return.

If you call this method repeatedly, each call returns immediately, without blocking for any awaiting consumption from the iteration.

See Also 参照

Producing Elements