Closed rakeshar3796 closed 2 weeks ago
@justjake am edited the script for better understanding, could you take a look and point it out if see any issues above?
If you are going to use await
inside the VM to call async functions, you don't need newQuickJSAsyncWASMModule
. newQuickJSAsyncWASMModule
is only necessary when the VM wants to call a synchronous function, but the synchronous function needs to be an async function in the host.
Here what is happening is that at the await
in await request("WORLD")
, quickjs suspends execution as a pending job. Execution continues once you call runtime.executePendingJobs
,
I've a custom function which returns a promise but the code isn't waiting till the response
The output am getting as
The expected output is,
The host console execution should wait till the code execution gets complete. When i complete the request once its working fine as expected but if i call more than once am seeing some uncertanities.
@justjake can you check this out!