You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any ideas why this is the case? Not sure if I'm doing something wrong or if this is a bug. It seems to work fine if I either remove the tokio::spawn altogether and just run in the main function, or await the JoinHandle for the tasks.
Build environment (please complete the following information):
OS: macOS
Version: Tested both 0.17.3 and main branch, same behaviour
Remember that all tokio futures must be polled by a tokio executor to progress. The default job executor doesn't use an async executor, it only blocks on all future jobs.
If you need this functionality, you'd have to override the JobQueue and use a thread-local tokio executor to push all futures forward.
Good! Also, remember to call run_jobs_async to push the futures forward, or else the context will just evaluate the code without evaluating any of the futures and promises
Describe the bug
Async rust functions called from js seem to hang/get stuck forever when using tokio.
To Reproduce
Spawn tasks in a loop that execute a simple javascript script which calls a single function
sleep
that is a rust async native function:This results in the below output: (this is all the output I get, all 8 "Start sleeping..." lines get printed immediately then gets stuck forever)
Any ideas why this is the case? Not sure if I'm doing something wrong or if this is a bug. It seems to work fine if I either remove the
tokio::spawn
altogether and just run in the main function, or await theJoinHandle
for the tasks.Build environment (please complete the following information):
The text was updated successfully, but these errors were encountered: