A lightweight job framework for Bevy.

Overview

bevy_jobs

A lightweight job framework for Bevy.

Getting started

Defining a job:

pub struct FetchRequestJob {
    pub url: String,
}

impl bevy_jobs::Job for FetchRequestJob {
    type Outcome = Result<Vec<u8>, Error>;

    fn name(&self) -> String {
        format!("Fetching request: '{}'", url);
    }

    fn perform(self) -> bevy_jobs::AsyncReturn<Self::Outcome> {
        Box::pin(async move {
            fetch(&self.url).await
        })
    }
}

Spawning a job from a system:

fn some_spawn_system(
    mut job_spawner: bevy_jobs::JobSpawner,
) {
    job_spawner.spawn(FetchRequestJob {
        url: "https://example.com/".into(),
    });
}

Fetching job results from a system:

fn some_result_system(
    mut finished_jobs: bevy_jobs::FinishedJobs,
) {
    while let Some(result) = finished_jobs.take_next::<FetchRequestJob>() {
        // ...
    }
}

Querying in-progress jobs:

fn render_in_progress(
    query: Query<&bevy_jobs::InProgressJob>,
) {
    for job in &query {
        println!("Job '{}' is running", job.name);
    }
}
You might also like...
A lightweight, cross-platform epub reader.
A lightweight, cross-platform epub reader.

Pend Pend is a program for reading EPUB files. Check out the web demo! Preview Image(s) Installation Building Pend is simple & easy. You should be abl

Ktx is a lightweight terminal-ui utility for editing Kubernetes config
Ktx is a lightweight terminal-ui utility for editing Kubernetes config

ktx Ktx is a lightweight terminal-ui utility for editing the kubectl config If you work with a large infrastructure where you have to jump between clu

A lightweight standard for non-fungible assets.
A lightweight standard for non-fungible assets.

Nifty Asset A lightweight standard for non-fungible assets. Contents Features Overview Packages Building Testing Programs Clients CLI License Warning

A Bevy plugin for loading the LDtk 2D tile map format.
A Bevy plugin for loading the LDtk 2D tile map format.

bevy_ldtk ( Tileset from "Cavernas" by Adam Saltsman ) A Bevy plugin for loading LDtk tile maps. Usage use bevy::prelude::*; use bevy_ldtk::*; fn mai

Basic first-person fly camera for the Bevy game engine

bevy_flycam A basic first-person fly camera for Bevy 0.4 Controls WASD to move horizontally SPACE to ascend LSHIFT to descend ESC to grab/release curs

An ergonomic physics API for bevy games.

Heron An ergonomic physics API for 2d and 3d bevy games. (powered by rapier) How it looks like fn main() { App::build() .add_plugins(DefaultPlug

Inspector plugin for the bevy game engine
Inspector plugin for the bevy game engine

bevy-inspector-egui This crate provides the ability to annotate structs with a #[derive(Inspectable)], which opens a debug interface using egui where

A plugin for Egui integration into Bevy
A plugin for Egui integration into Bevy

bevy_egui This crate provides a Egui integration for the Bevy game engine. Features: Desktop and web (bevy_webgl2) platforms support Clipboard (web su

Crossterm plugin for the bevy game engine
Crossterm plugin for the bevy game engine

What is bevy_crossterm? bevy_crossterm is a Bevy plugin that uses crossterm as a renderer. It provides custom components and events which allow users

Owner
Corey Farwell
he/him or they/them
Corey Farwell
bevy-hikari is an implementation of voxel cone tracing global illumination with anisotropic mip-mapping in Bevy

Bevy Voxel Cone Tracing bevy-hikari is an implementation of voxel cone tracing global illumination with anisotropic mip-mapping in Bevy. Bevy Version

研究社交 208 Dec 27, 2022
A simple extension for `bevy-editor-pls` to support tilemap editing right inside the bevy app.

What is this This is a simple tilemap editor plugin, that hooks right into bevy_editor_pls to work with bevy_ecs_tilemap. It works completely within i

null 3 May 8, 2023
Bevy Simple Portals is a Bevy game engine plugin aimed to create portals.

Portals for Bevy Bevy Simple Portals is a Bevy game engine plugin aimed to create portals. Those portals are (for now) purely visual and can be used t

Sélène Amanita 11 May 28, 2023
Minecraft using Bevy and Bevy-Meshem

minecraft_bevy Minecraft_bevy was built to showcase bevy_meshem. After a week of developing it has: Chunk loading / unloading each chunk's mesh is bei

Adam 7 Oct 4, 2023
Heavy - an opinionated, efficient, relatively lightweight, and tightly Lua-integrated game framework for Rust

Heavy - an opinionated, efficient, relatively lightweight, and tightly Lua-integrated game framework for Rust Slow down, upon the teeth of Orange Heav

Shea Leffler 12 Mar 18, 2022
A framework for building adventure games in Bevy.

Bevy_adventure A framework for building 3d adventure games in Bevy. preview.mp4 Features Interactive trait is the backbone of the framework, allowing

Hank Jordan 9 Jan 5, 2023
Work-in-Progress, opinionated game framework built on Bevy.

Bones A work-in-progress, opinionated game meta-engine built on Bevy. Under development for future use in the Jumpy game, and possibly other FishFolk

Fish Folk 9 Jan 3, 2023
A framework for saving and loading game state in Bevy.

Bevy_save A framework for saving and loading game state in Bevy. Features bevy_save is primarily built around extension traits to Bevy's World. Serial

Hank Jordan 10 Jan 24, 2023
A save/load framework for Bevy game engine.

?? Moonshine Save A save/load framework for Bevy game engine. Overview In Bevy, it is possible to serialize and deserialize a World using a DynamicSce

null 7 Mar 27, 2023
A lightweight Datalog engine in Rust

datafrog Datafrog is a lightweight Datalog engine intended to be embedded in other Rust programs. Datafrog has no runtime, and relies on you to build

The Rust Programming Language 693 Jan 2, 2023