AsyncKiteJs
An engine that lives on one dispatcher, so suspending code can use it from anywhere.
The engine underneath is single-threaded, as JavaScript is. Every call here hops onto the engine's own dispatcher, which runs one thing at a time, so two callers never overlap.
val js = asyncKiteJs()
js.use { println(js.evaluate("1 + 1").asDouble()) }
js.close()Content copied to clipboard
Functions
Link copied to clipboard
Hands the script a promise that settles when deferred does.
Link copied to clipboard
Runs source and, if it answers a promise, waits for that promise to settle.
Link copied to clipboard
suspend fun suspendFunction(target: JsObject, name: String, arity: Int = 0, scope: CoroutineScope, body: suspend (List<JsValue>) -> Any?): JsFunction