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
registerProcessor is doing odd things with threads and JS values #1945
Comments
Yes, we missed the structured serialization step:
I guess we still need to expand on what should happen on the control thread side, preferably in a form of algorithm? In short:
|
OK, so the That is, is the actual desired flow that |
Or does the control thread really store |
The array of The step 8 of
It's already an iterable, but do you think we still have to pack it in |
Not quite, what user code provides is some JS Value, which you then try to extract a list of AudioParamDescriptor from. This extraction process should be clearly defined.
The only sane way to do that check is to actually convert them to
What is?
If you want to support general iterables, then yes. Structured serialization knows nothing about iterables per se; it just knows about certain types of special objects. You can structured-serialize the whole thing over and then do your extraction of the list of values and conversion of those values to I don't necessarily have a strong opinion on which option you should pick here, honestly, but I do want the behavior to be defined. That said, if I were designing this API, I suspect I would do the iteration and validation before the cross-thread send, at which point what is getting sent is a |
Several clarification PRs have been merged, I think now we can tackle this:
|
I am revisiting this and the current state resolved all the issues discussed here: But its numbering scheme is somehow broken, so I will fix that. |
The number scheme will be fixed by #2030. Otherwise this issue is addressed. |
#2030 is merged. Closing. |
https://webaudio.github.io/web-audio-api/#dom-audioworkletglobalscope-registerprocessor step 10 does:
but descriptors can be a JS Array at that point. Is the reference to this Array being handed to a different thread? How is that supposed to work?
The text was updated successfully, but these errors were encountered: