bevy/crates/bevy_ecs/src/system
James Liu 42e61557f8
Immediately apply deferred system params in System::run (#11823)
# Objective
Fixes #11821. 

## Solution
* Run `System::apply_deferred` in `System::run` after executing the
system.
* Switch to using `System::run_unsafe` in `SingleThreadedExecutor` to
preserve the current behavior.
* Remove the `System::apply_deferred` in `SimpleExecutor` as it's now
redundant.
* Remove the `System::apply_deferred` when running one-shot systems, as
it's now redundant.

---

## Changelog
Changed: `System::run` will now immediately apply deferred system params
after running the system.

## Migration Guide
`System::run` will now always run `System::apply_deferred` immediately
after running the system now. If you were running systems and then
applying their deferred buffers at a later point in time, you can
eliminate the latter.

```rust
// in 0.13
system.run(world);
// .. sometime later ...
system.apply_deferred(world);

// in 0.14
system.run(world);
```

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2024-02-24 14:01:06 +00:00
..
commands refactor: Extract parallel queue abstraction (#7348) 2024-02-19 16:31:15 +00:00
adapter_system.rs bevy_ecs address trivial cases of unsafe_op_in_unsafe_fn (#11861) 2024-02-22 00:04:38 +00:00
combinator.rs bevy_ecs address trivial cases of unsafe_op_in_unsafe_fn (#11861) 2024-02-22 00:04:38 +00:00
exclusive_function_system.rs Fix SystemTypeSet::system_type being out of sync with System::type_id (#12030) 2024-02-21 23:40:45 +00:00
exclusive_system_param.rs impl ExclusiveSystemParam for PhantomData (#11153) 2024-01-01 16:02:21 +00:00
function_system.rs bevy_ecs address trivial cases of unsafe_op_in_unsafe_fn (#11861) 2024-02-22 00:04:38 +00:00
mod.rs Remove APIs deprecated in 0.13 (#11974) 2024-02-19 19:04:47 +00:00
query.rs fix some typos (#12038) 2024-02-22 18:55:22 +00:00
system.rs Immediately apply deferred system params in System::run (#11823) 2024-02-24 14:01:06 +00:00
system_name.rs impl ExclusiveSystemParam for SystemName (#11163) 2024-01-01 17:08:29 +00:00
system_param.rs fix some typos (#12038) 2024-02-22 18:55:22 +00:00
system_registry.rs Immediately apply deferred system params in System::run (#11823) 2024-02-24 14:01:06 +00:00