Skip to content

Commit

Permalink
Update availability checks
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianfett committed Jun 11, 2024
1 parent 10b11f6 commit 8ec67a1
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions Sources/NIOCore/EventLoop+SerialExecutor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ extension NIODefaultEventLoopExecutor: SerialExecutor {
///
/// Implementers of `EventLoop` should consider conforming to this protocol as
/// well on Swift 6.0 and later.
@available(macOS 9999.0, iOS 9999.0, watchOS 9999.0, tvOS 9999.0, *)
@available(macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, *)
public protocol NIOTaskEventLoopExecutor: NIOSerialEventLoopExecutor & TaskExecutor { }

@available(macOS 9999.0, iOS 9999.0, watchOS 9999.0, tvOS 9999.0, *)
@available(macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, *)
extension NIOTaskEventLoopExecutor {
@inlinable
func asUnownedTaskExecutor() -> UnownedTaskExecutor {
Expand All @@ -102,7 +102,7 @@ extension NIOTaskEventLoopExecutor {
}
}

@available(macOS 9999.0, iOS 9999.0, watchOS 9999.0, tvOS 9999.0, *)
@available(macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, *)
extension NIODefaultEventLoopExecutor: TaskExecutor {
@inlinable
public func asUnownedTaskExecutor() -> UnownedTaskExecutor {
Expand Down
2 changes: 1 addition & 1 deletion Sources/NIOCore/EventLoop.swift
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ extension EventLoop {
#endif

#if compiler(>=6.0)
@available(macOS 9999.0, iOS 9999.0, watchOS 9999.0, tvOS 9999.0, *)
@available(macOS 15.0, iOS 9999.0, watchOS 9999.0, tvOS 9999.0, *)
public var taskExecutor: any TaskExecutor {
NIODefaultEventLoopExecutor(self)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/NIOEmbedded/AsyncTestingEventLoop.swift
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ extension NIOAsyncTestingEventLoop: NIOSerialEventLoopExecutor { }

// MARK: TaskExecutor conformance
#if compiler(>=6.0)
@available(macOS 9999.0, iOS 9999.0, watchOS 9999.0, tvOS 9999.0, *)
@available(macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, *)
extension NIOAsyncTestingEventLoop: NIOTaskEventLoopExecutor { }
#endif

Expand Down
2 changes: 1 addition & 1 deletion Sources/NIOEmbedded/Embedded.swift
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public final class EmbeddedEventLoop: EventLoop {
#endif

#if compiler(>=6.0)
@available(macOS 9999.0, iOS 9999.0, watchOS 9999.0, tvOS 9999.0, *)
@available(macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, *)
public var taskExecutor: any TaskExecutor {
fatalError("EmbeddedEventLoop is not thread safe and cannot be used as a TaskExecutor. Use NIOAsyncTestingEventLoop instead.")
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/NIOPosix/SelectableEventLoop.swift
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,6 @@ internal func assertExpression(_ body: () -> Bool) {

// MARK: TaskExecutor conformance
#if compiler(>=6.0)
@available(macOS 9999.0, iOS 9999.0, watchOS 9999.0, tvOS 9999.0, *)
@available(macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, *)
extension SelectableEventLoop: NIOTaskEventLoopExecutor { }
#endif
6 changes: 3 additions & 3 deletions Tests/NIOPosixTests/TaskExecutorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import XCTest
final class TaskExecutorTests: XCTestCase {

#if compiler(>=6.0)
@available(macOS 9999.0, iOS 9999.0, watchOS 9999.0, tvOS 9999.0, *)
@available(macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, *)
func _runTests(loop1: some EventLoop, loop2: some EventLoop) async {
await withTaskGroup(of: Void.self) { taskGroup in
taskGroup.addTask(executorPreference: loop1.taskExecutor) {
Expand Down Expand Up @@ -57,7 +57,7 @@ final class TaskExecutorTests: XCTestCase {
}
#endif

@available(macOS 9999.0, iOS 9999.0, watchOS 9999.0, tvOS 9999.0, *)
@available(macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, *)
func testSelectableEventLoopAsTaskExecutor() async throws {
#if compiler(>=6.0)
let group = MultiThreadedEventLoopGroup(numberOfThreads: 2)
Expand All @@ -72,7 +72,7 @@ final class TaskExecutorTests: XCTestCase {
#endif
}

@available(macOS 9999.0, iOS 9999.0, watchOS 9999.0, tvOS 9999.0, *)
@available(macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, *)
func testAsyncTestingEventLoopAsTaskExecutor() async throws {
#if compiler(>=6.0)
let loop1 = NIOAsyncTestingEventLoop()
Expand Down

0 comments on commit 8ec67a1

Please sign in to comment.