-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Open
Labels
A-TasksTools for parallel and async workTools for parallel and async workC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorS-Needs-InvestigationThis issue requires detective work to figure out what's going wrongThis issue requires detective work to figure out what's going wrong
Description
Bevy version: 0.16.1
OS: Windows 10
What you did
This is a bit of a weird one because I could have sworn it used to work and it still works on wasm. I'm spawning a future on the IoTaskPool like so (the future is a bsky api request and compat allows tokio compatibility):
bevy::tasks::IoTaskPool::get().spawn(Compat::new(
CLIENT.service.app.bsky.actor.get_profile(
get_profile::ParametersData {
actor: actor.clone(),
}
.into(),
),
))
I then have a separate system running which polls the task in the Update Schedule
match ask.task.as_mut().and_then(|task| bevy::tasks::block_on(
bevy::tasks::futures_lite::future::poll_once(task)
)) {
Some(Ok(profile)) => ...
Some(Err(e)) => ...
None => return,
}
ask.task = None;
What went wrong
this is working perfectly on wasm! however on native builds the task never finishes. If I debug print the task then I get
Task(
Task {
header: Header {
scheduled: true,
running: false,
completed: false,
closed: false,
awaiter: false,
task: true,
ref_count: 2,
metadata: (),
},
},
)
which I think means it's been scheduled but never gets run which is very bizarre.
Unsure on what could be happening here
Metadata
Metadata
Assignees
Labels
A-TasksTools for parallel and async workTools for parallel and async workC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorS-Needs-InvestigationThis issue requires detective work to figure out what's going wrongThis issue requires detective work to figure out what's going wrong