For example, in tokio
we have yield_now.
Is there some equivalent functionality in bevy
?
bevy::tasks::AsyncComputeTaskPool::get().spawn(async move || {
loop {
...
???::yield_now();
}
});
For example, in tokio
we have yield_now.
Is there some equivalent functionality in bevy
?
bevy::tasks::AsyncComputeTaskPool::get().spawn(async move || {
loop {
...
???::yield_now();
}
});
yield_now
is a pretty basic future that doesn't really need support from the async runtime, so you can use any implementation, like for example futures_lite::future::yield_now
(futures_lite
should already be included in your dependency graph if you're using Bevy).
By the way for future Bevy questions I suggest you to ask on their Discord or their Github Discussions.
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.