Thanks for teaching, I think I have one more question:
If I use Handle::current
and Handle::spawn
, is there a way to join these tasks after complete? In my current codebase, I'm using TaskTracker
to spawn async tasks, so these tasks will be automatically be joined.
After I rewrite my code with TaskTracker
, instead of using Handle::current
and Handle::spawn
APIs (sorry I didn't follow your instructions yet, but I will try later) The cargo build
is current, and there's a new error:
thread 'main' panicked at src\js\binding\global.rs:76:34:
`spawn_local` called from outside of a `task::LocalSet`
stack backtrace:
Why I prefer using TaskTracker
? Because in a previous topic (How to share tokio JoinSet across different tasks/threads? - #3 by alice), I learned this skill from another expert, hope I didn't misunderstand it, please correct me if I'm wrong.
Thanks