mirror of
https://github.com/apple/swift-nio-extras.git
synced 2025-06-01 10:36:15 +08:00
Strict concurrency for NIOHTTPResponsiveness and NIOHTTPResponsivenessTests
This commit is contained in:
parent
dc6987e77e
commit
40a1214cba
@ -229,9 +229,7 @@ var targets: [PackageDescription.Target] = [
|
||||
.product(name: "HTTPTypes", package: "swift-http-types"),
|
||||
.product(name: "Algorithms", package: "swift-algorithms"),
|
||||
],
|
||||
swiftSettings: [
|
||||
.enableExperimentalFeature("StrictConcurrency")
|
||||
]
|
||||
swiftSettings: strictConcurrencySettings
|
||||
),
|
||||
.testTarget(
|
||||
name: "NIOHTTPResponsivenessTests",
|
||||
@ -242,9 +240,7 @@ var targets: [PackageDescription.Target] = [
|
||||
.product(name: "NIOEmbedded", package: "swift-nio"),
|
||||
.product(name: "HTTPTypes", package: "swift-http-types"),
|
||||
],
|
||||
swiftSettings: [
|
||||
.enableExperimentalFeature("StrictConcurrency")
|
||||
]
|
||||
swiftSettings: strictConcurrencySettings
|
||||
),
|
||||
]
|
||||
|
||||
|
@ -253,3 +253,6 @@ public final class HTTPDrippingDownloadHandler: ChannelDuplexHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@available(*, unavailable)
|
||||
extension HTTPDrippingDownloadHandler: Sendable {}
|
||||
|
@ -88,3 +88,6 @@ public final class HTTPReceiveDiscardHandler: ChannelInboundHandler {
|
||||
context.writeAndFlush(self.wrapOutboundOut(.end(nil)), promise: nil)
|
||||
}
|
||||
}
|
||||
|
||||
@available(*, unavailable)
|
||||
extension HTTPReceiveDiscardHandler: Sendable {}
|
||||
|
@ -143,3 +143,6 @@ public final class SimpleResponsivenessRequestMux: ChannelInboundHandler {
|
||||
context.writeAndFlush(self.wrapOutboundOut(.end(nil)), promise: nil)
|
||||
}
|
||||
}
|
||||
|
||||
@available(*, unavailable)
|
||||
extension SimpleResponsivenessRequestMux: Sendable {}
|
||||
|
@ -101,9 +101,11 @@ if #available(macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4, *) {
|
||||
|
||||
let group = MultiThreadedEventLoopGroup(numberOfThreads: System.coreCount)
|
||||
let server = try ServerBootstrap(group: group).childChannelInitializer { channel in
|
||||
channel.pipeline.configureHTTPServerPipeline().flatMap {
|
||||
channel.pipeline.addHandlers([
|
||||
HTTP1ToHTTPServerCodec(secure: false),
|
||||
channel.eventLoop.makeCompletedFuture {
|
||||
let sync = channel.pipeline.syncOperations
|
||||
try sync.configureHTTPServerPipeline()
|
||||
try sync.addHandler(HTTP1ToHTTPServerCodec(secure: false))
|
||||
try sync.addHandler(
|
||||
HTTPResumableUploadHandler(
|
||||
context: uploadContext,
|
||||
handlers: [
|
||||
@ -111,8 +113,8 @@ if #available(macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4, *) {
|
||||
directory: URL(fileURLWithPath: CommandLine.arguments[1], isDirectory: true)
|
||||
)
|
||||
]
|
||||
),
|
||||
])
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
.bind(host: "0.0.0.0", port: 8080)
|
||||
|
Loading…
x
Reference in New Issue
Block a user