bevy_async_runner/
lib.rs

1use bevy::app::App;
2use bevy::prelude::{Commands, Plugin, ResMut, Update};
3pub use crate::runner::AsyncRunner;
4
5mod runner;
6
7pub struct AsyncRunnerPlugin;
8
9impl Plugin for AsyncRunnerPlugin {
10    fn build(&self, app: &mut App) {
11        app.insert_resource(AsyncRunner::new())
12            .add_systems(Update, complete_futures);
13    }
14}
15
16fn complete_futures(mut scheduler: ResMut<AsyncRunner>, commands: Commands) {
17    scheduler.run(commands);
18}