Skip to content

Commit 3cac957

Browse files
authored
Drop support for Swift 5.9 (#549)
1 parent ecbc3eb commit 3cac957

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

.github/workflows/test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
swift-image:
21-
- swift:5.9-jammy
22-
- swift:5.10-noble
21+
- swift:5.10-jammy
2322
- swift:6.0-noble
23+
- swift:6.1-noble
2424
- swiftlang/swift:nightly-main-jammy
2525
container: ${{ matrix.swift-image }}
2626
runs-on: ubuntu-latest
@@ -58,7 +58,7 @@ jobs:
5858
- postgres-image: postgres:12
5959
postgres-auth: trust
6060
container:
61-
image: swift:5.10-noble
61+
image: swift:6.1-noble
6262
volumes: [ 'pgrunshare:/var/run/postgresql' ]
6363
runs-on: ubuntu-latest
6464
env:

Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.9
1+
// swift-tools-version:5.10
22
import PackageDescription
33

44
let swiftSettings: [SwiftSetting] = [

Sources/ConnectionPoolModule/ConnectionPool.swift

-10
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,11 @@ public final class ConnectionPool<
273273

274274
public func run() async {
275275
await withTaskCancellationHandler {
276-
#if os(Linux) || compiler(>=5.9)
277276
if #available(macOS 14.0, iOS 17.0, tvOS 17.0, watchOS 10.0, *) {
278277
return await withDiscardingTaskGroup() { taskGroup in
279278
await self.run(in: &taskGroup)
280279
}
281280
}
282-
#endif
283281
return await withTaskGroup(of: Void.self) { taskGroup in
284282
await self.run(in: &taskGroup)
285283
}
@@ -313,14 +311,12 @@ public final class ConnectionPool<
313311
case scheduleTimer(StateMachine.Timer)
314312
}
315313

316-
#if os(Linux) || compiler(>=5.9)
317314
@available(macOS 14.0, iOS 17.0, tvOS 17.0, watchOS 10.0, *)
318315
private func run(in taskGroup: inout DiscardingTaskGroup) async {
319316
for await event in self.eventStream {
320317
self.runEvent(event, in: &taskGroup)
321318
}
322319
}
323-
#endif
324320

325321
private func run(in taskGroup: inout TaskGroup<Void>) async {
326322
var running = 0
@@ -507,11 +503,7 @@ public final class ConnectionPool<
507503
await withTaskGroup(of: TimerRunResult.self, returning: Void.self) { taskGroup in
508504
taskGroup.addTask {
509505
do {
510-
#if os(Linux) || compiler(>=5.9)
511506
try await self.clock.sleep(for: timer.duration)
512-
#else
513-
try await self.clock.sleep(until: self.clock.now.advanced(by: timer.duration), tolerance: nil)
514-
#endif
515507
return .timerTriggered
516508
} catch {
517509
return .timerCancelled
@@ -579,15 +571,13 @@ protocol TaskGroupProtocol {
579571
mutating func addTask_(operation: @escaping @Sendable () async -> Void)
580572
}
581573

582-
#if os(Linux) || swift(>=5.9)
583574
@available(macOS 14.0, iOS 17.0, tvOS 17.0, watchOS 10.0, *)
584575
extension DiscardingTaskGroup: TaskGroupProtocol {
585576
@inlinable
586577
mutating func addTask_(operation: @escaping @Sendable () async -> Void) {
587578
self.addTask(priority: nil, operation: operation)
588579
}
589580
}
590-
#endif
591581

592582
extension TaskGroup<Void>: TaskGroupProtocol {
593583
@inlinable

0 commit comments

Comments
 (0)