Files
David Nadoba e18db27dd3 Replace TransactionBody with NIOAsyncSequenceProducer (#677)
* save progress

* Replace `TransactionBody` with `NIOAsyncSequenceProducer`

* test

* revert unnesscary changes

* Add end-to-end test

which currently fails because of https://github.com/apple/swift-nio/issues/2398

* soundness

* Use latest swift-nio release

* throw CancellationError on task cancelation

* Fix Swift 5.5 & 5.6
2023-04-12 15:11:56 +01:00

38 lines
1.0 KiB
Swift

//===----------------------------------------------------------------------===//
//
// This source file is part of the AsyncHTTPClient open source project
//
// Copyright (c) 2023 Apple Inc. and the AsyncHTTPClient project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AsyncHTTPClient project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import NIOCore
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
@usableFromInline
struct AnyAsyncSequenceProducerDelegate: NIOAsyncSequenceProducerDelegate {
@usableFromInline
var delegate: NIOAsyncSequenceProducerDelegate
@inlinable
init<Delegate: NIOAsyncSequenceProducerDelegate>(_ delegate: Delegate) {
self.delegate = delegate
}
@inlinable
func produceMore() {
self.delegate.produceMore()
}
@inlinable
func didTerminate() {
self.delegate.didTerminate()
}
}