Yokan / rebuild
Course 1 8624561

QuickJsJavaScriptEngine.jvm.kt

composeApp/src/jvmCommonMain/kotlin/eu/friedcutlet/yokan/services/extensions/js/QuickJsJavaScriptEngine.jvm.kt

implementation15 lines
1@file:OptIn(ExperimentalCoroutinesApi::class)23package eu.friedcutlet.yokan.services.extensions.js45import kotlinx.coroutines.CloseableCoroutineDispatcher6import kotlinx.coroutines.ExperimentalCoroutinesApi7import kotlinx.coroutines.asCoroutineDispatcher8import java.util.concurrent.Executors910internal actual const val QuickJsMaxStackSizeBytes: Long = 8L * 1024L * 1024L1112// Daemon, so a runtime that is never disposed cannot keep the desktop JVM alive.13internal actual fun quickJsDispatcher(stackBytes: Long): CloseableCoroutineDispatcher =14    Executors.newSingleThreadExecutor { task -> Thread(null, task, "quickjs", stackBytes).apply { isDaemon = true } }15        .asCoroutineDispatcher()16

Search chapters, reference and source filenames.