# Objective
- `glam`, `hexasphere` & `rand` have released their latest versions,
update Bevy to support them.
## Solution
- The above have been updated to their compatible versions. `rand_distr`
updated as well to match `rand` v0.10 support.
- `rand_chacha` is soft deprecated and no longer used by `rand`, so its
usage has been changed to `chacha20` to match `rand` dep tree.
- `uuid` is in the process of updating to `getrandom` v0.4, which `rand`
v0.10 supports. This PR remains in draft until a new `uuid` release hits
crates.io.
- `RngCore` is now `Rng`, and `Rng` is now `RngExt`, so this required
updating across many files.
- `choose_multiple` method is deprecated, changed to `sample`.
## Testing
- Chase all compiler errors, since this should not regress any already
existing behaviour.
- This must pass CI without regressions.
## Additional Notes
`getrandom` v0.4 doesn't add anything new for Web WASM support, so the
same `wasm_js` feature is used.
# Objective
In #21598 and the related Discord discussion, it was pointed out that
the `async_compute` example promotes an inefficient and potentially
error-prone pattern: `future::block_on(poll_once)`.
It is now recommended to use `bevy::tasks::futures::check_ready`
instead, which is much cheaper and avoids blocking the main thread while
waiting on the future. Another valid approach is to pass a channel into
the async tasks and detach them, letting the channel handle task
readiness.
This PR implements both suggestions.
## Solution
* **Updated `async_compute` example**
Replaced the use of `future::block_on(poll_once)` with the recommended
`check_ready`.
The change is minimal and limited to the directly affected lines.
* **Added new example: `async_channel_pattern`**
Demonstrates how to spawn async tasks using a channel-based
communication pattern.
* Each task is executed on a separate thread via `AsyncComputeTaskPool`.
* Results (cube positions) are sent back through a `CubeChannel` once
completed.
* Tasks are detached to run fully asynchronously, ensuring the main
thread remains unblocked.
* A rotating light in the scene visually indicates that the frame loop
remains responsive.
I am relatively new to both Bevy and async Rust, and I genuinely
appreciate any feedback or suggestions to improve these examples —
especially regarding idiomatic async patterns and best practices for
Bevy task management.
Fixes#21598
---------
Co-authored-by: syszery <syszery@users.noreply.github.com>
Co-authored-by: François Mockers <francois.mockers@vleue.com>