bevy/crates/bevy_asset/src/server
Mincong Lu 1d950e6195
Allow AssetServer::load to acquire a guard item. (#13051)
# Objective

Supercedes #12881 . Added a simple implementation that allows the user
to react to multiple asset loads both synchronously and asynchronously.

## Solution

Added `load_acquire`, that holds an item and drops it when loading is
finished or failed.

When used synchronously 

Hold an `Arc<()>`, check for `Arc::strong_count() == 1` when all loading
completed.

When used asynchronously 

Hold a `SemaphoreGuard`, await on `acquire_all` for completion.

This implementation has more freedom than the original in my opinion.

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Zachary Harrold <zac@harrold.com.au>
2024-05-23 13:28:29 +00:00
..
info.rs Fix beta lints (#12980) 2024-04-16 02:46:46 +00:00
loaders.rs Instrument asset loading and processing. (#12988) 2024-04-16 12:02:11 +00:00
mod.rs Allow AssetServer::load to acquire a guard item. (#13051) 2024-05-23 13:28:29 +00:00