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

spec clarification: allow multiple open() and close() requests, and multiple calls to requestMIDIAccess() #128

Open
toyoshim opened this issue Mar 12, 2015 · 4 comments · May be fixed by #277
Assignees
Labels
category: enhancement https://www.w3.org/policies/process/#class-3 Needs Edits https://speced.github.io/spec-maintenance/about/ Priority: Soon https://speced.github.io/spec-maintenance/about/
Milestone

Comments

@toyoshim
Copy link
Contributor

For now the spec say nothing about multiple outstanding open() or close() requests.
But, what happens if open() is called before the previous open() is not resolved?

I feel it's ok to call async function that returns Promise many times before the previous call finishes.
Before JavaScript has the Promise, typical async APIs, e.g., File API, does not allow multiple requests, and the second request will throw InvalidStateError. But we can manage multiple requests with Promise.

@cwilso cwilso changed the title spec clarification: allow multiple open() and close() requests spec clarification: allow multiple open() and close() requests, and multiple calls to requestMIDIAccess() Mar 12, 2015
@cwilso
Copy link
Contributor

cwilso commented Mar 12, 2015

This should also apply to multiple requestMIDIAccess calls - where the app may decide to time out and re-request without sysex, for example.

@toyoshim
Copy link
Contributor Author

Agreed. Current Chrome implementation also allows multiple requestMIDIAccess calls.

@cwilso cwilso self-assigned this Mar 12, 2015
@cwilso cwilso added the Needs Edits https://speced.github.io/spec-maintenance/about/ label Mar 12, 2015
@cwilso cwilso added this to the V1 milestone Mar 12, 2015
@agoode
Copy link

agoode commented Mar 12, 2015

A question about Promises. Would the spec allow implementations to return the same Promise object for multiple open() calls?

@cwilso
Copy link
Contributor

cwilso commented Mar 12, 2015

I think you actually want to have different promises.

@mjwilson-google mjwilson-google added the category: enhancement https://www.w3.org/policies/process/#class-3 label Sep 13, 2023
@mjwilson-google mjwilson-google added the Priority: Soon https://speced.github.io/spec-maintenance/about/ label Nov 27, 2024
@mjwilson-google mjwilson-google self-assigned this Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: enhancement https://www.w3.org/policies/process/#class-3 Needs Edits https://speced.github.io/spec-maintenance/about/ Priority: Soon https://speced.github.io/spec-maintenance/about/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants