Repository: apple/swift-nio
File: Sources/NIOCore/AsyncSequences/NIOAsyncSequenceProducer.swift (Swift)

Code before:
            @inlinable
            deinit {
                // We need to call finish here to resume any suspended continuation.
                self._throwingSource.finish()
            }
        }

        @usableFromInline
        /* private */ internal let _internalClass: InternalClass

        @usableFromInline
        /* private */ internal var _throwingSource: InternalClass.ThrowingSource {
            self._internalClass._throwingSource
        }

        @usableFromInline
        /* fileprivate */ internal init(throwingSource: InternalClass.ThrowingSource) {
            self._internalClass = .init(throwingSource: throwingSource)
        }

        /// The result of a call to ``NIOAsyncSequenceProducer/Source/yield(_:)``.
        public enum YieldResult: Hashable {
            /// Indicates that the caller should produce more elements for now. The delegate's ``NIOAsyncSequenceProducerDelegate/produceMore()``
            /// method will get called once production should be resumed.
            case produceMore
            /// Indicates that the caller should stop producing elements.
            case stopProducing
            /// Indicates that the yielded elements have been dropped because the sequence already terminated.
            case dropped
        }

        /// Yields a sequence of new elements to the ``NIOAsyncSequenceProducer``.
        ///
        /// If there is an ``NIOAsyncSequenceProducer/AsyncIterator`` awaiting the next element, it will get resumed right away.
        /// Otherwise, the element will get buffered.
        ///
        /// If the ``NIOAsyncSequenceProducer`` is terminated this will drop the elements
        /// and return ``YieldResult/dropped``.
        ///
        /// This can be called more than once and returns to the caller immediately
        /// without blocking for any awaiting consumption from the iteration.
        ///
        /// - Parameter contentsOf: The sequence to yield.
        /// - Returns: A ``NIOAsyncSequenceProducer/Source/YieldResult`` that indicates if the yield was successful
        /// and if more elements should be produced.
        @inlinable
        public func yield<S: Sequence>(contentsOf sequence: S) -> YieldResult where S.Element == Element {
            switch self._throwingSource.yield(contentsOf: sequence) {
            case .stopProducing:
                return .stopProducing
            case .produceMore:

Review comment (suggestion):
```suggestion
            /// Indicates that the caller should produce more elements for now. The delegate's ``NIOAsyncSequenceProducerDelegate/produceMore()`` will not get called, since the demand was already signaled through this ``YieldResult``
            case produceMore
            /// Indicates that the caller should stop producing elements. The delegate's ``NIOAsyncSequenceProducerDelegate/produceMore()``
            /// method will get called once production should be resumed.
```

Code after:
                self._throwingSource = throwingSource
            }

            @inlinable
            deinit {
                // We need to call finish here to resume any suspended continuation.
                self._throwingSource.finish()
            }
        }

        @usableFromInline
        /* private */ internal let _internalClass: InternalClass

        @usableFromInline
        /* private */ internal var _throwingSource: InternalClass.ThrowingSource {
            self._internalClass._throwingSource
        }

        @usableFromInline
        /* fileprivate */ internal init(throwingSource: InternalClass.ThrowingSource) {
            self._internalClass = .init(throwingSource: throwingSource)
        }

        /// The result of a call to ``NIOAsyncSequenceProducer/Source/yield(_:)``.
        public enum YieldResult: Hashable {
            /// Indicates that the caller should produce more elements for now. The delegate's ``NIOAsyncSequenceProducerDelegate/produceMore()``
            /// will **NOT** get called, since the demand was already signalled through this ``YieldResult``
            case produceMore
            /// Indicates that the caller should stop producing elements. The delegate's ``NIOAsyncSequenceProducerDelegate/produceMore()``
            /// will get called once production should be resumed.
            case stopProducing
            /// Indicates that the yielded elements have been dropped because the sequence already terminated.
            case dropped
        }

        /// Yields a sequence of new elements to the ``NIOAsyncSequenceProducer``.
        ///
        /// If there is an ``NIOAsyncSequenceProducer/AsyncIterator`` awaiting the next element, it will get resumed right away.
        /// Otherwise, the element will get buffered.
        ///
        /// If the ``NIOAsyncSequenceProducer`` is terminated this will drop the elements
        /// and return ``YieldResult/dropped``.
        ///
        /// This can be called more than once and returns to the caller immediately
        /// without blocking for any awaiting consumption from the iteration.
        ///
        /// - Parameter contentsOf: The sequence to yield.
        /// - Returns: A ``NIOAsyncSequenceProducer/Source/YieldResult`` that indicates if the yield was successful
        /// and if more elements should be produced.
        @inlinable
        public func yield<S: Sequence>(contentsOf sequence: S) -> YieldResult where S.Element == Element {