{"id":15138048,"url":"https://github.com/not-elm/bevy_flurx","last_synced_at":"2026-03-09T07:07:50.168Z","repository":{"id":200107272,"uuid":"703990027","full_name":"not-elm/bevy_flurx","owner":"not-elm","description":"Allows you to write sequential description of processes involving delays, user input, and other waits.","archived":false,"fork":false,"pushed_at":"2024-10-25T11:22:46.000Z","size":1285,"stargazers_count":53,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-29T21:02:08.455Z","etag":null,"topics":["async","bevy","bevy-plugin","game-development","rust"],"latest_commit_sha":null,"homepage":"https://docs.rs/bevy_flurx/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/not-elm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-12T10:08:36.000Z","updated_at":"2024-09-04T15:40:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"42aaaf5b-71b5-43a9-94a6-77090d8804b5","html_url":"https://github.com/not-elm/bevy_flurx","commit_stats":{"total_commits":174,"total_committers":4,"mean_commits":43.5,"dds":"0.48275862068965514","last_synced_commit":"31180b479734c621c4c15eab5ab74d3e6dc2216c"},"previous_names":["elm-register/bevy_async_system","mlulm/bevy_async_system","elmtw/bevy_async_system","not-elm/bevy_flurx"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/not-elm%2Fbevy_flurx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/not-elm%2Fbevy_flurx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/not-elm%2Fbevy_flurx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/not-elm%2Fbevy_flurx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/not-elm","download_url":"https://codeload.github.com/not-elm/bevy_flurx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247052079,"owners_count":20875678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","bevy","bevy-plugin","game-development","rust"],"created_at":"2024-09-26T07:20:18.841Z","updated_at":"2026-03-09T07:07:44.616Z","avatar_url":"https://github.com/not-elm.png","language":"Rust","funding_links":[],"categories":["Code Organization"],"sub_categories":[],"readme":"# bevy_flurx\n\n[![Crates.io](https://img.shields.io/crates/v/bevy_flurx.svg)](https://crates.io/crates/bevy_flurx)\n[![MIT/Apache 2.0](https://img.shields.io/badge/license-MIT%2FApache-blue.svg)](https://github.com/not-elm/bevy_flurx#license)\n[![Crates.io](https://img.shields.io/crates/d/bevy_flurx.svg)](https://crates.io/crates/bevy_flurx)\n\nThis library provides functionality similar to coroutines, allowing you to write sequential processing for delays, user input, animations, and more.\n\n[Reactor](https://docs.rs/bevy_flurx/latest/bevy_flurx/prelude/struct.Reactor.html) can be used incrementally, meaning there’s no need to rewrite existing applications to incorporate it.\n\n```rust\n//! Here are some basic [once], [wait], [delay], [then], [pipe] and [through] actions.\n//!\n//! For details on all actions, please check [here](https://docs.rs/bevy_flurx/latest/bevy_flurx/action/index.html).\n//!\n//! [once]: https://docs.rs/bevy_flurx/latest/bevy_flurx/action/once/index.html\n//! [wait]: https://docs.rs/bevy_flurx/latest/bevy_flurx/action/wait/index.html\n//! [delay]: https://docs.rs/bevy_flurx/latest/bevy_flurx/action/delay/index.html\n//! [then]: https://docs.rs/bevy_flurx/latest/bevy_flurx/action/sequence/trait.Then.html#tymethod.then\n//! [pipe]: https://docs.rs/bevy_flurx/latest/bevy_flurx/action/pipe/trait.Pipe.html#tymethod.pipe\n//! [through]: https://docs.rs/bevy_flurx/latest/bevy_flurx/action/through/fn.through.html\n\nuse bevy::prelude::*;\nuse bevy_flurx::prelude::*;\nuse std::time::Duration;\n\nfn main() {\n    App::new()\n        .insert_resource(Count(0))\n        .add_plugins((\n            DefaultPlugins,\n            FlurxPlugin,\n        ))\n        .add_systems(Startup, spawn_reactor)\n        .run();\n}\n\n#[derive(Resource)]\nstruct Count(usize);\n\nfn spawn_reactor(mut commands: Commands) {\n    commands.spawn(Reactor::schedule(|task| async move {\n        // `once` module defines the actions that runs only once.\n        // For example, once::run once executes any system.\n        // other once actions: https://docs.rs/bevy_flurx/latest/bevy_flurx/action/once/index.html\n        let current_count: usize = task.will(Update, once::run(|mut count: ResMut\u003cCount\u003e| {\n            count.0 += 1;\n            count.0\n        })).await;\n        assert_eq!(current_count, 1);\n\n        // ActionSeed and Action have input and output the generic types.\n        // You can call `ActionSeed::with(\u003cinput\u003e)` to pass the input to action seed.\n        let result: usize = task.will(Update, once::run(|In(num): In\u003cusize\u003e| {\n            num + 3\n        }).with(3)).await;\n        assert_eq!(result, 6);\n\n        // The wait module defines actions that continue to execute every frame according to specified conditions.\n        // For example, wait::until takes a system that returns a bool value and continues to execute it until it returns true.\n        // other wait actions: https://docs.rs/bevy_flurx/latest/bevy_flurx/action/wait/index.html\n        task.will(Update, wait::until(|mut count: ResMut\u003cCount\u003e| {\n            count.0 += 1;\n            info!(\"current count: {}\", count.0);\n            count.0 == 4\n        })).await;\n\n        // delay module defines the actions that perform delay processing.\n        task.will(Update, delay::time().with(std::time::Duration::from_secs(1))).await;\n\n        // `then`, `pipe` and through`  are also actions that continues to execute another action.\n        let message = task.will(Update, {\n            delay::frames().with(30)\n                .then(once::run(|count: Res\u003cCount\u003e| {\n                    count.0\n                }))\n                // Pipes the output of an action to the input of the next action.\n                .pipe(once::run(|In(count): In\u003cusize\u003e| {\n                    format!(\"count is {count}\")\n                }))\n                // Executes the next while keeping the output of the previous action.\n                .through(delay::time().with(Duration::from_secs(1)))\n        }).await;\n        assert_eq!(message, \"count is 4\");\n\n        info!(\"Done!\");\n        task.will(Update, once::event::app_exit_success()).await;\n    }));\n}\n```\n\n## Example\n\nAll examples are [`here`](./examples).\n\n## Feature flags\n\n| flag name   | short description                                                                  | default |\n|-------------|------------------------------------------------------------------------------------|---------|\n| audio       | audio actions                                                                      | false   |\n| record      | undo/redo actions and events                                                       | false   | \n| side-effect | thread/async side effects                                                          | false   |\n| state       | state actions                                                                      | false   | \n| tokio       | allows to use write asynchronous functions depend on tokio directly in the reactor | false   | \n\n### audio\n\nProvides the actions that perform simple audio playback and waiting using bevy's default audio functionality.\n\n- [`once::audio`](https://docs.rs/bevy_flurx/latest/bevy_flurx/action/once/audio)\n- [`wait::audio`](https://docs.rs/bevy_flurx/latest/bevy_flurx/action/wait/audio)\n\n### record\n\n[doc.rs](https://docs.rs/bevy_flurx/latest/bevy_flurx/action/record/index.html)\n\nProvides `Record` to manage operation history.\n\n![undo_redo](examples/undo_redo.gif)\n\n### side-effect\n\n[doc.rs](https://docs.rs/bevy_flurx/latest/bevy_flurx/action/effect/index.html)\n\nAllows to convert the operations with side effects such as asynchronous runtime or thread into the\nreferential-transparent actions.\n\n### tokio\n\nYou will be able to write processes that depend on tokio's runtime in the reactor.\n\n## ChangeLog\n\nPlease see [here](https://github.com/not-elm/bevy_flurx/blob/main/CHANGELOG.md).\n\n## Compatible Bevy versions\n\n| bevy_flurx | bevy   |\n|------------|--------|\n| 0.3.0 ~    | 0.13.0 |\n| 0.6.0 ~    | 0.14.1 | \n| 0.7.0 ~    | 0.15   | \n| 0.11 ~     | 0.16   |\n\n## Credits\n\nUsing [bevy_game_template](https://github.com/NiklasEi/bevy_game_template) to CI.\n\n## License\n\nThis crate is licensed under the MIT License or the Apache License 2.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnot-elm%2Fbevy_flurx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnot-elm%2Fbevy_flurx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnot-elm%2Fbevy_flurx/lists"}