-
Notifications
You must be signed in to change notification settings - Fork 4
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
Async loading of bundles work with configurable string fetcher. #1
Conversation
src/source.rs
Outdated
Missing => None, | ||
Loaded(res) => Some(res), | ||
Loading(..) => { | ||
panic!("[l10nregistry] Attempting to synchronously load file {} while it's being loaded asynchronously.", &full_path); |
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.
could we here debug_print
and drop the async load, and replace it with a sync load?
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.
Or we could perform a sync load and not update the cache? I wasn't sure which was the best approach.
I wanted to be able to replace the loading state with loaded and fire the value to the waiting futures, but I'm not sure how to do that. A potential solution would be to store a oneshot::Sender
and Shared<oneshot::Receiver>
. The async loading future could then check that the state is still loading, and if so, send
the result. The sync loading could do the same.
It's a little more complicated and I just wanted to get the system working. Could be leave this and open a issue to implement a more desirable behavior?
936e5ae
to
004128f
Compare
670ed00
to
07f4583
Compare
07f4583
to
1c6f469
Compare
No description provided.