pecs
is a plugin for Bevy that allows you
to execute code asynchronously by chaining multple promises as part of Bevy's ecs
enviroment.
pecs
stands for Promise Entity Component System
.
Resources: - Docs - Examples - Report an issue - Provide an idea
then()
state
for promises is like self
for items)asyn
mod and stateful state.asyn()
system params
fetching (promise asyn!
funcs accepts the same params
the bevy systems does)Promise::any()
/Promise::all()
or stateful state.any()
/state.all()
with(value)
/map(func)
(change state type/value over chain calls)with_ok(value)
/map_ok(func)
(change result type/value over chain calls)```rust use bevy::prelude::; use pecs::prelude::; fn main() { App::new() .addplugins(DefaultPlugins) .addplugin(PecsPlugin) .addstartupsystem(setup) .run(); }
fn setup(mut commands: Commands) { commands.add( Promise::start(asyn!(state, time: Res
This repo is more like an experimental-proof-of-concept than a production-ready library. API could and will change. App will crash (there are some untested unsafe blocks), some promises will silently drop (there are stil no unit tests), documentation is incomplete and so on. But. But. Examples works like a charm. And this fact gives us a lot of hope.
The pecs
is dual-licensed under either:
This means you can select the license you prefer! This dual-licensing approach is the de-facto standard in the Rust ecosystem and there are very good reasons to include both.