Enumerationswift 6.0.1_Concurrency
YieldResult
A type that indicates the result of yielding a value to a client, by way of the continuation.
- iOS
- 13.0+
- macOS
- 10.15+
- tvOS
- 13.0+
- watchOS
- 6.0+
enum YieldResult
The various yield
methods of AsyncThrowingStream.Continuation
return this type to indicate the success or failure of yielding an element to the continuation.
Cases
case dropped(Element)
The stream didn’t enqueue the element because the buffer was full.
case enqueued(remaining: Int)
The stream successfully enqueued the element.
case terminated
The stream didn’t enqueue the element because the stream was in a terminal state.
Other members in extension
Types
enum BufferingPolicy
A strategy that handles exhaustion of a buffer’s capacity.
enum Termination
A type that indicates how the stream terminated.
Instance members
var onTermination: ((AsyncThrowingStream<Element, Failure>.Continuation.Termination) -> Void)?
A callback to invoke when canceling iteration of an asynchronous stream.
func finish(throwing: Failure?
) Resume the task awaiting the next iteration point by having it return nil, which signifies the end of the iteration.
func yield(sending
Element) -> AsyncThrowingStream<Element, Failure>.Continuation.YieldResult Resume the task awaiting the next iteration point by having it return normally from its suspension point with a given element.