JavaScriptKit Documentation

Class Java​Script​Event​Loop

public final class JavaScriptEventLoop: SerialExecutor, @unchecked Sendable  
%65 JavaScriptEventLoop JavaScriptEventLoop SerialExecutor SerialExecutor JavaScriptEventLoop->SerialExecutor @unchecked Sendable @unchecked Sendable JavaScriptEventLoop->@unchecked Sendable

Conforms To

@unchecked Sendable
SerialExecutor

Properties

shared

public static let shared: JavaScriptEventLoop  

A singleton instance of the Executor

Methods

install​Global​Executor()

public static func installGlobalExecutor()  

Set JavaScript event loop based executor to be the global executor Note that this should be called before any of the jobs are created. This installation step will be unnecessary after the custom-executor will be introduced officially. See also: https://github.com/rjmccall/swift-evolution/blob/custom-executors/proposals/0000-custom-executors.md#the-default-global-concurrent-executor

enqueue(_:​)

public func enqueue(_ job: UnownedJob)  

as​Unowned​Serial​Executor()

public func asUnownedSerialExecutor() -> UnownedSerialExecutor