bevy/crates/bevy_ecs/src/schedule
Pixelstorm faa1b57de5
Global TaskPool API improvements (#10008)
# Objective

Reduce code duplication and improve APIs of Bevy's [global
taskpools](https://github.com/bevyengine/bevy/blob/main/crates/bevy_tasks/src/usages.rs).

## Solution

- As all three of the global taskpools have identical implementations
and only differ in their identifiers, this PR moves the implementation
into a macro to reduce code duplication.
- The `init` method is renamed to `get_or_init` to more accurately
reflect what it really does.
- Add a new `try_get` method that just returns `None` when the pool is
uninitialized, to complement the other getter methods.
- Minor documentation improvements to accompany the above changes.

---

## Changelog

- Added a new `try_get` method to the global TaskPools
- The global TaskPools' `init` method has been renamed to `get_or_init`
for clarity
- Documentation improvements

## Migration Guide

- Uses of `ComputeTaskPool::init`, `AsyncComputeTaskPool::init` and
`IoTaskPool::init` should be changed to `::get_or_init`.
2023-10-23 20:48:48 +00:00
..
executor Global TaskPool API improvements (#10008) 2023-10-23 20:48:48 +00:00
condition.rs Remove States::variants and remove enum-only restriction its derive (#9945) 2023-09-30 22:32:39 +00:00
config.rs Fix some typos (#9934) 2023-09-26 19:46:24 +00:00
graph_utils.rs Remove reference to base sets (#9032) 2023-07-03 20:44:10 +00:00
mod.rs Global TaskPool API improvements (#10008) 2023-10-23 20:48:48 +00:00
schedule.rs Updates for rust 1.73 (#10035) 2023-10-06 00:31:10 +00:00
set.rs One Shot Systems (#8963) 2023-09-19 20:17:05 +00:00
state.rs Remove States::variants and remove enum-only restriction its derive (#9945) 2023-09-30 22:32:39 +00:00