Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ jobs:
unit-tests:
uses: vapor/ci/.github/workflows/run-unit-tests.yml@main
secrets: inherit
with:
with_wasm: true
16 changes: 13 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
// swift-tools-version:5.10
import PackageDescription

/// This list matches the [supported platforms on the Swift 5.10 release of SPM](https://github.com/swiftlang/swift-package-manager/blob/release/5.10/Sources/PackageDescription/SupportedPlatforms.swift#L34-L71)
/// Don't add new platforms here unless raising the swift-tools-version of this manifest.
let allPlatforms: [Platform] = [.macOS, .macCatalyst, .iOS, .tvOS, .watchOS, .visionOS, .driverKit, .linux, .windows, .android, .wasi, .openbsd]
let nonWASIPlatforms: [Platform] = allPlatforms.filter { $0 != .wasi }
let wasiPlatform: [Platform] = [.wasi]

let package = Package(
name: "async-kit",
platforms: [
Expand All @@ -13,28 +19,32 @@ let package = Package(
.library(name: "AsyncKit", targets: ["AsyncKit"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-nio.git", from: "2.61.0"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.89.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.3"),
.package(url: "https://github.com/apple/swift-collections.git", from: "1.0.5"),
.package(url: "https://github.com/apple/swift-algorithms.git", from: "1.1.0"),
.package(url: "https://github.com/PassiveLogic/swift-dispatch-async.git", from: "1.0.0"),
],
targets: [
.target(
name: "AsyncKit",
dependencies: [
.product(name: "Logging", package: "swift-log"),
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOEmbedded", package: "swift-nio"),
.product(name: "NIOPosix", package: "swift-nio"),
.product(name: "NIOEmbedded", package: "swift-nio", condition: .when(platforms: nonWASIPlatforms)),
.product(name: "NIOPosix", package: "swift-nio", condition: .when(platforms: nonWASIPlatforms)),
.product(name: "Collections", package: "swift-collections"),
.product(name: "Algorithms", package: "swift-algorithms"),
.product(name: "DispatchAsync", package: "swift-dispatch-async", condition: .when(platforms: wasiPlatform))
],
swiftSettings: swiftSettings
),
.testTarget(
name: "AsyncKitTests",
dependencies: [
.target(name: "AsyncKit"),
.product(name: "NIOEmbedded", package: "swift-nio"),
.product(name: "NIOPosix", package: "swift-nio"),
],
swiftSettings: swiftSettings
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#if canImport(Dispatch)
import Dispatch
#elseif canImport(DispatchAsync)
import DispatchAsync
#endif
import NIOConcurrencyHelpers
import NIOCore
import struct Logging.Logger
Expand Down Expand Up @@ -280,6 +284,7 @@ public final class EventLoopGroupConnectionPool<Source> where Source: Connection
}
}

#if !os(WASI)
/// Closes the connection pool.
///
/// All available connections will be closed immediately. Any connections still in use will be
Expand Down Expand Up @@ -312,6 +317,7 @@ public final class EventLoopGroupConnectionPool<Source> where Source: Connection
}
}
}
#endif // !os(WASI)

/// Closes the connection pool.
///
Expand Down
4 changes: 4 additions & 0 deletions Sources/AsyncKit/Exports.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#if canImport(NIOEmbedded)
@_documentation(visibility: internal) @_exported import class NIOEmbedded.EmbeddedEventLoop
#endif
@_documentation(visibility: internal) @_exported import protocol NIOCore.EventLoop
@_documentation(visibility: internal) @_exported import protocol NIOCore.EventLoopGroup
@_documentation(visibility: internal) @_exported import class NIOCore.EventLoopFuture
@_documentation(visibility: internal) @_exported import struct NIOCore.EventLoopPromise
#if canImport(NIOPosix)
@_documentation(visibility: internal) @_exported import class NIOPosix.MultiThreadedEventLoopGroup
#endif
1 change: 1 addition & 0 deletions Tests/AsyncKitTests/ConnectionPoolTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Logging
import NIOConcurrencyHelpers
import NIOCore
import NIOEmbedded
import class NIOPosix.MultiThreadedEventLoopGroup
import XCTest

final class ConnectionPoolTests: AsyncKitTestCase {
Expand Down