Skip to content

Commit 04a6d8a

Browse files
Remove enqueueMainJob
1 parent a0c4602 commit 04a6d8a

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

Sources/JavaScriptEventLoop/JavaScriptEventLoop.swift

-15
Original file line numberDiff line numberDiff line change
@@ -188,21 +188,6 @@ public final class JavaScriptEventLoop: SerialExecutor, @unchecked Sendable {
188188
public func asUnownedSerialExecutor() -> UnownedSerialExecutor {
189189
return UnownedSerialExecutor(ordinary: self)
190190
}
191-
192-
public static func enqueueMainJob(_ job: consuming ExecutorJob) {
193-
self.enqueueMainJob(UnownedJob(job))
194-
}
195-
196-
static func enqueueMainJob(_ job: UnownedJob) {
197-
let currentEventLoop = JavaScriptEventLoop.shared
198-
if currentEventLoop === JavaScriptEventLoop.mainThreadEventLoop {
199-
currentEventLoop.unsafeEnqueue(job)
200-
} else {
201-
// Notify the main thread to execute the job
202-
let jobBitPattern = unsafeBitCast(job, to: UInt.self)
203-
_ = JSObject.global.postMessage!(jobBitPattern)
204-
}
205-
}
206191
}
207192

208193
#if compiler(>=5.7)

0 commit comments

Comments
 (0)