NIOAsyncSequenceProducerDelegate
The delegate of NIOAsyncSequenceProducer
.
- iOS
- 13+
- macOS
- 10.15+
- tvOS
- 13+
- watchOS
- 6+
protocol NIOAsyncSequenceProducerDelegate : Sendable
Browse conforming typesThe delegate of NIOAsyncSequenceProducer
.
protocol NIOAsyncSequenceProducerDelegate : Sendable
import NIOCore
The core abstractions that make up SwiftNIO.
struct NIOAsyncSequenceProducer<Element, Strategy, Delegate> where Element : Sendable, Strategy : NIOAsyncSequenceProducerBackPressureStrategy, Delegate : NIOAsyncSequenceProducerDelegate
This is an AsyncSequence
that supports a unicast AsyncIterator
.
protocol Sendable
A thread-safe type whose values can be shared across arbitrary concurrent contexts without introducing a risk of data races. Values of the type may have no shared mutable state, or they may protect that state with a lock or by forcing it to only be accessed from a specific actor.
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.
func didTerminate()
This method is called once the NIOAsyncSequenceProducer
is terminated.
func yield<S>(contentsOf sequence: S) -> NIOAsyncSequenceProducer<Element, Strategy, Delegate>.Source.YieldResult where Element == S.Element, S : Sequence
Yields a sequence of new elements to the NIOAsyncSequenceProducer
.
struct NIOThrowingAsyncSequenceProducer<Element, Failure, Strategy, Delegate> where Element : Sendable, Failure : Error, Strategy : NIOAsyncSequenceProducerBackPressureStrategy, Delegate : NIOAsyncSequenceProducerDelegate
This is an AsyncSequence
that supports a unicast AsyncIterator
.
protocol NIOAsyncSequenceProducerBackPressureStrategy : Sendable
A protocol for the back-pressure strategy of the NIOAsyncSequenceProducer
.
enum NIOAsyncSequenceProducerBackPressureStrategies
struct NIOAsyncWriter<Element, Delegate> where Element == Delegate.Element, Delegate : NIOAsyncWriterSinkDelegate
A NIOAsyncWriter
is a type used to bridge elements from the Swift Concurrency domain into a synchronous world. The Task
s that are yielding to the NIOAsyncWriter
are the producers. Whereas the NIOAsyncWriterSinkDelegate
is the consumer.
protocol NIOAsyncWriterSinkDelegate : Sendable
The delegate of the NIOAsyncWriter
. It is the consumer of the yielded writes to the NIOAsyncWriter
. Furthermore, the delegate gets informed when the NIOAsyncWriter
terminated.