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

yield(_:)

Resume the task awaiting the next iteration point by having it return nomally from its suspension point with a given element.

Declaration 宣言

@discardableResult func yield(_ value: Element) -> AsyncStream<Element>.Continuation.YieldResult

Parameters パラメータ

value

The value 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, this method attempts to buffer the result’s element.

This can be called more than once and returns to the caller immediately without blocking for any awaiting consumption from the iteration. これは一回以上呼び出されることが可能です、そして呼び出し側にすぐに復帰します、その反復からの何らかの待ち受けている消費ために遮断することなく。

See Also 参照

Producing Elements