Skip to content
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 and reloading #15

Open
hadronized opened this issue Apr 24, 2018 · 4 comments
Open

Async loading and reloading #15

hadronized opened this issue Apr 24, 2018 · 4 comments
Milestone

Comments

@hadronized
Copy link
Owner

This will be a bit tricky but with a Future interface, it should be okay.

@hadronized hadronized added this to the warmy-1.0 milestone Apr 24, 2018
@edwin0cheng
Copy link

edwin0cheng commented May 2, 2018

+1 for this feature, I would like to use warmy in our wasm game engine too.
But it need to be async loading since web resources are async in nature.

@hadronized
Copy link
Owner Author

Yep. I have an idea in mind on how to do it. Basically, I would like to keep both interface (sync and async). The async one is not very different:

  • Instead of returning a Result<Res<T>, _>, the Store::get method would return a Result<impl Future<Item = ARes<T>>, _>.
  • ARes would be the same as a Res but with Arc.

The missing parts are that I would like to implement an IO-bound thread instead of letting all asynchronous threads deal with the IO stuff. That’s a bit tricky, because all those threads would then be some kind of memory buffer consumers instead of paths or keys consumers. A bit tricky. :)

@edwin0cheng
Copy link

edwin0cheng commented May 2, 2018

That's good to know, however, I would like to know if it is possible to allow to use custom executor ? Since wasm do not support threading now, which the only option are polling :(

@hadronized
Copy link
Owner Author

What do you mean custom executor? I plan to add a way to plugin event loops and custom “event sources”, if it’s what you’re referring to. 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants