Skip to content

Commit 5171d9c

Browse files
Fix ExperimentalCustomExecutors SPI import build issues
The custom executor feature is now hidden behind the `ExperimentalCustomExecutors` SPI until it goes through the evolution process. swiftlang/swift#86808
1 parent bffab39 commit 5171d9c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Sources/JavaScriptEventLoop/JavaScriptEventLoop+ExecutorFactory.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
// See: https://github.com/swiftlang/swift/pull/80266
55
// See: https://forums.swift.org/t/pitch-2-custom-main-and-global-executors/78437
66

7-
import _Concurrency
7+
@_spi(ExperimentalCustomExecutors) import _Concurrency
88
import _CJavaScriptKit
99

1010
#if compiler(>=6.3)
1111

1212
// MARK: - MainExecutor Implementation
1313
// MainExecutor is used by the main actor to execute tasks on the main thread
1414
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999, *)
15+
@_spi(ExperimentalCustomExecutors)
1516
extension JavaScriptEventLoop: MainExecutor {
1617
public func run() throws {
1718
// This method is called from `swift_task_asyncMainDrainQueueImpl`.
@@ -27,6 +28,7 @@ extension JavaScriptEventLoop: MainExecutor {
2728
extension JavaScriptEventLoop: TaskExecutor {}
2829

2930
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999, *)
31+
@_spi(ExperimentalCustomExecutors)
3032
extension JavaScriptEventLoop: SchedulingExecutor {
3133
public func enqueue<C: Clock>(
3234
_ job: consuming ExecutorJob,
@@ -65,6 +67,7 @@ extension JavaScriptEventLoop: SchedulingExecutor {
6567

6668
// MARK: - ExecutorFactory Implementation
6769
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999, *)
70+
@_spi(ExperimentalCustomExecutors)
6871
extension JavaScriptEventLoop: ExecutorFactory {
6972
// Forward all operations to the current thread's JavaScriptEventLoop instance
7073
final class CurrentThread: TaskExecutor, SchedulingExecutor, MainExecutor, SerialExecutor {

Sources/JavaScriptEventLoop/JavaScriptEventLoop.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import JavaScriptKit
2-
import _Concurrency
2+
@_spi(ExperimentalCustomExecutors) import _Concurrency
33
import _CJavaScriptEventLoop
44
import _CJavaScriptKit
55

0 commit comments

Comments
 (0)