-
-
Notifications
You must be signed in to change notification settings - Fork 47
Closed
Description
local res = sleep(1):next(function ()
sleep(10):await()
return 15
end)
print("res", res:await())Returns
Error: Lua Error(ErrorRun/2): cannot resume dead coroutine
at Thread.assertOk (/home/tstableford/projects/wasmoon/dist/index.js:409:23)
at Thread.<anonymous> (/home/tstableford/projects/wasmoon/dist/index.js:142:22)
at Generator.throw (<anonymous>)
at rejected (/home/tstableford/projects/wasmoon/dist/index.js:26:69)
This makes sense because aren't async and aren't threads. That means they attempt to run within the parent thread. If they did run in a child thread then it would be possible to make jsFunc's async but then it would get a bit mad with async everywhere.
Maybe there's a good solution and maybe not, if there's not though it should be documented.
Metadata
Metadata
Assignees
Labels
No labels