Internal rewrite of bevy_asset with slight api changes. #272
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These changes started as an async (async as in an async runtime) rewrite of the bevy_asset crate. During that process, I removed
AssetLoadRequestHandler
, redesigned howAssetLoaders
are stored and accessed, and changed thebevy_asset
api slightly, making it a little more typesafe and consistent. In the end, I removed the async runtime because async filesystem io isn't actually async and instead added arayon::ThreadPool
to do work in the background. Since the threadpool is isolated from the global pool, it should be alright to run io jobs on it. It would be easy enough to add back support for "async", but I don't think it's really that useful in this case.The most notable api change is that
AssetLoader
now hasAsset
as an associated type, rather than as a type parameter. I think this is better, but I may be able to find a way to change it back if preferred.