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

Consider refactoring the APIs to use Future s. #48

Open
MaulingMonkey opened this issue Aug 31, 2019 · 1 comment
Open

Consider refactoring the APIs to use Future s. #48

MaulingMonkey opened this issue Aug 31, 2019 · 1 comment

Comments

@MaulingMonkey
Copy link
Contributor

MaulingMonkey commented Aug 31, 2019

Web MIDI support is made awkward in a couple of places by the browser's use of async/deferred callbacks:

  • Getting input/output device lists (need to request access first)
  • Opening/closing devices

Futures should, at least in theory, keep the API relatively sane (allowing you to write async code or to simply .wait() in traditional sync code)

The wasm_bindgen_futures crate provides JsFuture, which looks like it should make this quite straightforward.

@Boscop
Copy link

Boscop commented May 11, 2020

If that is done, async not be the default/only way, the blocking way should still be possible.

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

No branches or pull requests

2 participants