-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Allow adding and removing asset sources at runtime. #21890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
3be29fa to
5528a8c
Compare
greeble-dev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't spot any issues and tests passed. Just added some minor comments.
One thing I was left wondering about - do readers and writers still need to be passed to AssetSourceBuilder as closures that produce the value? I understand this was necessary when sources weren't shared. But is it true now that they're shared?
b8059fa to
b980d56
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I read the whole thing and could not find any logical issues. Comments are just suggestions to improve readability / any future debugging. I also checked out your branch and also verified that tests pass. Thanks for adding such clear tests!
In case you wanted my 2c on expected behavior for asset server removal, what you said sounds reasonable. If you waaaanted to, you could note the behavior in your release notes but say that this behavior may change depending on community input and see if anyone says anything / has suggestions, but I leave that to you!
andriyDev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you waaaanted to, you could note the behavior in your release notes
Yeah I considered this. I decided to avoid including it just because I'm sure everyone will have their own "obviously correct behavior", where some will be varying degrees of painful-to-implement. I don't think anyone will notice this weirdness for a long time. Kinda a bad reason, but I don't feel like opening that can of worms lol.
0c1fcfa to
b5a9c12
Compare
c829989 to
70d62c6
Compare
|
@andriyDev this isn't going to make 0.18, but when you get a chance can you resolve the merge conflicts? |
70d62c6 to
588cb59
Compare
|
@alice-i-cecile Rebased! I also added an additional commit to clean up some cases that didn't need their own test setup, thanks to this PR. Fewer separate test setup code means we're less likely to accidentally start reading the FS again. |
… adding the AssetPlugin.
…ter the processor starts.
Co-authored-by: Greeble <[email protected]>
Co-authored-by: Greeble <[email protected]>
…urceError::SourceIsProcessed.
…can add them after.
4c11e6d to
7c05f81
Compare
Objective
Solution
AssetPlugininclude aDefaultAssetSourceenum to initialize the default source when adding theAssetPlugin.DefaultAssetSourceneeds to contain a Mutex, since we need to be able to use the builder, butPluginonly provides us with a shared reference in the plugin.RwLockaround the asset sources.One thing that is not addressed is the behavior after removing an asset source. This PR leaves it in a state where assets loaded from that asset source remain loaded. If you re-add the asset source, it does not reload the asset. But if the asset changes on the asset source, it should reload again. I'm kinda leaving it undefined since it's not clear what the correct behavior here should be anyway.
Testing