Skip to content

Commit

Permalink
More cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianfett committed Jun 14, 2024
1 parent 32d7b13 commit e1b1586
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
8 changes: 4 additions & 4 deletions Sources/ConnectionPoolModule/ConnectionPool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public final class ConnectionPool<

public func run() async {
await withTaskCancellationHandler {
#if swift(>=5.8) && os(Linux) || swift(>=5.9)
#if os(Linux) || compiler(>=5.9)
if #available(macOS 14.0, iOS 17.0, tvOS 17.0, watchOS 10.0, *) {
return await withDiscardingTaskGroup() { taskGroup in
await self.run(in: &taskGroup)
Expand Down Expand Up @@ -313,7 +313,7 @@ public final class ConnectionPool<
case scheduleTimer(StateMachine.Timer)
}

#if swift(>=5.8) && os(Linux) || swift(>=5.9)
#if os(Linux) || compiler(>=5.9)
@available(macOS 14.0, iOS 17.0, tvOS 17.0, watchOS 10.0, *)
private func run(in taskGroup: inout DiscardingTaskGroup) async {
for await event in self.eventStream {
Expand Down Expand Up @@ -507,7 +507,7 @@ public final class ConnectionPool<
await withTaskGroup(of: TimerRunResult.self, returning: Void.self) { taskGroup in
taskGroup.addTask {
do {
#if swift(>=5.8) && os(Linux) || swift(>=5.9)
#if os(Linux) || compiler(>=5.9)
try await self.clock.sleep(for: timer.duration)
#else
try await self.clock.sleep(until: self.clock.now.advanced(by: timer.duration), tolerance: nil)
Expand Down Expand Up @@ -593,7 +593,7 @@ protocol TaskGroupProtocol {
mutating func addTask_(operation: @escaping @Sendable () async -> Void)
}

#if swift(>=5.8) && os(Linux) || swift(>=5.9)
#if os(Linux) || swift(>=5.9)
@available(macOS 14.0, iOS 17.0, tvOS 17.0, watchOS 10.0, *)
extension DiscardingTaskGroup: TaskGroupProtocol {
@inlinable
Expand Down
2 changes: 1 addition & 1 deletion Sources/PostgresNIO/New/NotificationListener.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ final class NotificationListener: @unchecked Sendable {
}


#if swift(<5.9)
#if compiler(<5.9)
// Async stream API backfill
extension AsyncThrowingStream {
static func makeStream(
Expand Down
11 changes: 0 additions & 11 deletions Sources/PostgresNIO/Utilities/Exports.swift
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
#if swift(>=5.8)

@_documentation(visibility: internal) @_exported import NIO
@_documentation(visibility: internal) @_exported import NIOSSL
@_documentation(visibility: internal) @_exported import struct Logging.Logger

#else

// TODO: Remove this with the next major release!
@_exported import NIO
@_exported import NIOSSL
@_exported import struct Logging.Logger

#endif

0 comments on commit e1b1586

Please sign in to comment.