Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,33 @@ permissions:
contents: read

on:
push:
branches: [main]
schedule:
- cron: "0 8,20 * * *"
push:
branches: [main]
schedule:
- cron: "0 8,20 * * *"

jobs:
unit-tests:
name: Unit tests
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
with:
linux_5_10_enabled: false
linux_6_0_enabled: false
linux_6_1_enabled: false
# linux_6_1_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
linux_6_2_enabled: false
# linux_6_2_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
linux_nightly_next_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
unit-tests:
name: Unit tests
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
with:
linux_5_10_enabled: false
linux_6_0_enabled: false
linux_6_1_enabled: false
# linux_6_1_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
linux_6_2_enabled: false
# linux_6_2_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
linux_nightly_next_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"

static-sdk:
name: Static SDK
uses: apple/swift-nio/.github/workflows/static_sdk.yml@main
static-sdk:
name: Static SDK
uses: apple/swift-nio/.github/workflows/static_sdk.yml@main

release-builds:
name: Release builds
uses: apple/swift-nio/.github/workflows/release_builds.yml@main
with:
linux_5_10_enabled: false
linux_6_0_enabled: false
linux_6_1_enabled: false
release-builds:
name: Release builds
uses: apple/swift-nio/.github/workflows/release_builds.yml@main
with:
linux_5_10_enabled: false
linux_6_0_enabled: false
linux_6_1_enabled: false
80 changes: 40 additions & 40 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,49 @@ permissions:
contents: read

on:
pull_request:
types: [opened, reopened, synchronize]
pull_request:
types: [opened, reopened, synchronize]

jobs:
soundness:
name: Soundness
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
with:
api_breakage_check_container_image: "swift:6.2-noble"
format_check_container_image: "swift:6.2-noble"
license_header_check_project_name: "Swift HTTP Server"
soundness:
name: Soundness
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
with:
api_breakage_check_container_image: "swift:6.2-noble"
format_check_container_image: "swift:6.2-noble"
license_header_check_project_name: "Swift HTTP Server"

unit-tests:
name: Unit tests
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
with:
linux_5_10_enabled: false
linux_6_0_enabled: false
linux_6_1_enabled: false
# linux_6_1_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_6_2_enabled: true
linux_6_2_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_nightly_next_arguments_override: "--explicit-target-dependency-import-check error"
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
unit-tests:
name: Unit tests
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
with:
linux_5_10_enabled: false
linux_6_0_enabled: false
linux_6_1_enabled: false
# linux_6_1_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_6_2_enabled: true
linux_6_2_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_nightly_next_arguments_override: "--explicit-target-dependency-import-check error"
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"

cxx-interop:
name: Cxx interop
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main
with:
linux_5_10_enabled: false
linux_6_0_enabled: false
linux_6_1_enabled: false
linux_6_2_enabled: true
cxx-interop:
name: Cxx interop
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main
with:
linux_5_10_enabled: false
linux_6_0_enabled: false
linux_6_1_enabled: false
linux_6_2_enabled: true

static-sdk:
name: Static SDK
uses: apple/swift-nio/.github/workflows/static_sdk.yml@main
static-sdk:
name: Static SDK
uses: apple/swift-nio/.github/workflows/static_sdk.yml@main

release-builds:
name: Release builds
uses: apple/swift-nio/.github/workflows/release_builds.yml@main
with:
linux_5_10_enabled: false
linux_6_0_enabled: false
linux_6_1_enabled: false
linux_6_2_enabled: true
release-builds:
name: Release builds
uses: apple/swift-nio/.github/workflows/release_builds.yml@main
with:
linux_5_10_enabled: false
linux_6_0_enabled: false
linux_6_1_enabled: false
linux_6_2_enabled: true
9 changes: 5 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ let extraSettings: [SwiftSetting] = [
.enableUpcomingFeature("InferIsolatedConformances"),
.enableUpcomingFeature("ExistentialAny"),
.enableUpcomingFeature("MemberImportVisibility"),
.enableUpcomingFeature("InternalImportsByDefault")
.enableUpcomingFeature("InternalImportsByDefault"),
]

let package = Package(
name: "HTTPServer",
products: [
.library(
name: "HTTPServer",
targets: ["HTTPServer"])
targets: ["HTTPServer"]
)
],
dependencies: [
.package(
Expand Down Expand Up @@ -65,7 +66,7 @@ let package = Package(
.product(name: "Logging", package: "swift-log"),
.product(name: "NIOHTTPTypesHTTP1", package: "swift-nio-extras"),
.product(name: "NIOHTTPTypesHTTP2", package: "swift-nio-extras"),
.product(name: "NIOCertificateReloading", package: "swift-nio-extras")
.product(name: "NIOCertificateReloading", package: "swift-nio-extras"),
],
swiftSettings: extraSettings
),
Expand All @@ -88,7 +89,7 @@ let package = Package(
name: "HTTPServerTests",
dependencies: [
.product(name: "Logging", package: "swift-log"),
"HTTPServer",
.target(name: "HTTPServer"),
]
),
]
Expand Down
5 changes: 2 additions & 3 deletions Sources/AsyncStreaming/EitherError.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift HTTP API Proposal open source project
// This source file is part of the Swift HTTP Server open source project
//
// Copyright (c) 2025 Apple Inc. and the Swift HTTP API Proposal project authors
// Copyright (c) 2025 Apple Inc. and the Swift HTTP Server project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Swift HTTP API Proposal project authors
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down
9 changes: 4 additions & 5 deletions Sources/AsyncStreaming/Internal/InlineArray+convenience.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift HTTP API Proposal open source project
// This source file is part of the Swift HTTP Server open source project
//
// Copyright (c) 2025 Apple Inc. and the Swift HTTP API Proposal project authors
// Copyright (c) 2025 Apple Inc. and the Swift HTTP Server project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Swift HTTP API Proposal project authors
//
// SPDX-License-Identifier: Apache-2.0
//
Expand All @@ -15,10 +14,10 @@
@available(macOS 26.0, iOS 26.0, watchOS 26.0, tvOS 26.0, visionOS 26.0, *)
extension InlineArray where Element: ~Copyable {
package static func one(value: consuming Element) -> InlineArray<1, Element> {
return InlineArray<1, Element>(first: value) { _ in fatalError() }
InlineArray<1, Element>(first: value) { _ in fatalError() }
}

package static func zero(of elementType: Element.Type = Element.self) -> InlineArray<0, Element> {
return InlineArray<0, Element> { _ in }
InlineArray<0, Element> { _ in }
}
}
5 changes: 2 additions & 3 deletions Sources/AsyncStreaming/Internal/Optional+SendingTake.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift HTTP API Proposal open source project
// This source file is part of the Swift HTTP Server open source project
//
// Copyright (c) 2025 Apple Inc. and the Swift HTTP API Proposal project authors
// Copyright (c) 2025 Apple Inc. and the Swift HTTP Server project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Swift HTTP API Proposal project authors
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down
7 changes: 3 additions & 4 deletions Sources/AsyncStreaming/Reader/Array+AsyncReader.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift HTTP API Proposal open source project
// This source file is part of the Swift HTTP Server open source project
//
// Copyright (c) 2025 Apple Inc. and the Swift HTTP API Proposal project authors
// Copyright (c) 2025 Apple Inc. and the Swift HTTP Server project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Swift HTTP API Proposal project authors
//
// SPDX-License-Identifier: Apache-2.0
//
Expand All @@ -32,7 +31,7 @@ extension Array {
/// }
/// ```
public func asyncReader() -> some AsyncReader<Element, Never> & SendableMetatype {
return ArrayAsyncReader(array: self)
ArrayAsyncReader(array: self)
}
}

Expand Down
5 changes: 2 additions & 3 deletions Sources/AsyncStreaming/Reader/AsyncReader+collect.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift HTTP API Proposal open source project
// This source file is part of the Swift HTTP Server open source project
//
// Copyright (c) 2025 Apple Inc. and the Swift HTTP API Proposal project authors
// Copyright (c) 2025 Apple Inc. and the Swift HTTP Server project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Swift HTTP API Proposal project authors
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down
5 changes: 2 additions & 3 deletions Sources/AsyncStreaming/Reader/AsyncReader+forEach.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift HTTP API Proposal open source project
// This source file is part of the Swift HTTP Server open source project
//
// Copyright (c) 2025 Apple Inc. and the Swift HTTP API Proposal project authors
// Copyright (c) 2025 Apple Inc. and the Swift HTTP Server project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Swift HTTP API Proposal project authors
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down
11 changes: 6 additions & 5 deletions Sources/AsyncStreaming/Reader/AsyncReader+map.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift HTTP API Proposal open source project
// This source file is part of the Swift HTTP Server open source project
//
// Copyright (c) 2025 Apple Inc. and the Swift HTTP API Proposal project authors
// Copyright (c) 2025 Apple Inc. and the Swift HTTP Server project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Swift HTTP API Proposal project authors
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -45,7 +44,7 @@ extension AsyncReader where Self: ~Copyable, Self: ~Escapable {
public consuming func map<MappedElement>(
_ transformation: @escaping (borrowing ReadElement) async -> MappedElement
) -> some (AsyncReader<MappedElement, ReadFailure> & ~Copyable & ~Escapable) {
return AsyncMapReader(base: self, transformation: transformation)
AsyncMapReader(base: self, transformation: transformation)
}
}

Expand All @@ -55,7 +54,9 @@ extension AsyncReader where Self: ~Copyable, Self: ~Escapable {
/// to each element read from the base reader. The transformation is applied lazily
/// as elements are read, maintaining the streaming nature of the operation.
@available(macOS 26.0, iOS 26.0, watchOS 26.0, tvOS 26.0, visionOS 26.0, *)
struct AsyncMapReader<Base: AsyncReader & ~Copyable & ~Escapable, MappedElement: ~Copyable>: AsyncReader, ~Copyable, ~Escapable {
struct AsyncMapReader<Base: AsyncReader & ~Copyable & ~Escapable, MappedElement: ~Copyable>: AsyncReader, ~Copyable,
~Escapable
{
typealias ReadElement = MappedElement
typealias ReadFailure = Base.ReadFailure

Expand Down
7 changes: 3 additions & 4 deletions Sources/AsyncStreaming/Reader/AsyncReader.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift HTTP API Proposal open source project
// This source file is part of the Swift HTTP Server open source project
//
// Copyright (c) 2025 Apple Inc. and the Swift HTTP API Proposal project authors
// Copyright (c) 2025 Apple Inc. and the Swift HTTP Server project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Swift HTTP API Proposal project authors
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -102,7 +101,7 @@ extension AsyncReader where Self: ~Copyable, Self: ~Escapable {
) async throws(Failure) -> Return where Self.ReadFailure == Never {
do {
return try await self.read(maximumCount: maximumCount) { (span) throws(Failure) -> Return in
return try await body(span)
try await body(span)
}
} catch {
switch error {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift HTTP API Proposal open source project
// This source file is part of the Swift HTTP Server open source project
//
// Copyright (c) 2025 Apple Inc. and the Swift HTTP API Proposal project authors
// Copyright (c) 2025 Apple Inc. and the Swift HTTP Server project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Swift HTTP API Proposal project authors
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down
5 changes: 2 additions & 3 deletions Sources/AsyncStreaming/Reader/ConcludingAsyncReader.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift HTTP API Proposal open source project
// This source file is part of the Swift HTTP Server open source project
//
// Copyright (c) 2025 Apple Inc. and the Swift HTTP API Proposal project authors
// Copyright (c) 2025 Apple Inc. and the Swift HTTP Server project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Swift HTTP API Proposal project authors
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down
Loading
Loading