stopProducing
Indicates that the caller should stop producing elements. The delegate’s produceMore
will get called once production should be resumed.
- iOS
- 13+
- macOS
- 10.15+
- tvOS
- 13+
- watchOS
- 6+
case stopProducing
Indicates that the caller should stop producing elements. The delegate’s produceMore
will get called once production should be resumed.
case stopProducing
s7NIOCore24NIOAsyncSequenceProducerV6SourceV11YieldResultO13stopProducingyAGyxq_q0___GAIms8SendableRzAA0bcD20BackPressureStrategyR_AA0bcD8DelegateR0_r1_lF
What are these?1QX5I
import NIOCore
The core abstractions that make up SwiftNIO.
enum YieldResult
The result of a call to yield(_:)
.
struct NIOAsyncSequenceProducer<Element, Strategy, Delegate> where Element : Sendable, Strategy : NIOAsyncSequenceProducerBackPressureStrategy, Delegate : NIOAsyncSequenceProducerDelegate
This is an AsyncSequence
that supports a unicast AsyncIterator
.
struct Source
A struct to interface between the synchronous code of the producer and the asynchronous consumer. This type allows the producer to synchronously yield
new elements to the NIOAsyncSequenceProducer
and to finish
the sequence.
func produceMore()
This method is called once the back-pressure strategy of the NIOAsyncSequenceProducer
determined that the producer needs to start producing more elements. Furthermore, it will also only be called if yield(_:)
returned a stopProducing
to indicate that new elements should be produced now. Except, in the case where yield(contentsOf:)
has never been called.
case produceMore
Indicates that the caller should produce more elements for now. The delegate’s produceMore
will NOT get called, since the demand was already signalled through this YieldResult
.
case dropped
Indicates that the yielded elements have been dropped because the sequence already terminated.