Hello, I tried creating computationally intensive tasks on wasm web, on separate threads using:
use std::thread;
use async_task::Task;
use bevy::tasks::futures::{check_ready, now_or_never};
use web_task::{spawn};
let task: Task<Option<NavigationPath>> = spawn(async move {
let current_thread = thread::current();
info!(
"Pathfinding is running on thread: name={:?}, id={:?}",
current_thread.name(),
current_thread.id()
);
let guard = obs_clone.read();
if let Ok(obstacles) = guard.as_ref() {
compute_path_towards(&*obstacles, pos, &target_clone, CELL_SIZE)
} else {
None
}
});
but it keeps printing "main" thread. I was thinking the purpose of this library is to specifically that right? Am I doing it wrong?
Hello, I tried creating computationally intensive tasks on wasm web, on separate threads using:
but it keeps printing "main" thread. I was thinking the purpose of this library is to specifically that right? Am I doing it wrong?