bevy-async-runner 0.1.2

Bevy Async Runner simplifies working with asynchronous code in the Bevy game engine. It provides a mechanism to schedule and execute async tasks and provide their result to any system.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use bevy::app::App;
use bevy::prelude::{Commands, Plugin, ResMut, Update};
pub use crate::runner::AsyncRunner;

mod runner;

pub struct AsyncRunnerPlugin;

impl Plugin for AsyncRunnerPlugin {
    fn build(&self, app: &mut App) {
        app.insert_resource(AsyncRunner::new())
            .add_systems(Update, complete_futures);
    }
}

fn complete_futures(mut scheduler: ResMut<AsyncRunner>, commands: Commands) {
    scheduler.run(commands);
}