Closed bfgeek closed 7 years ago
So if we go down that road we need to:
And presumably only audio worklets. I can help with the specification-side of that, but to land changes in those standards we'll also need to have web-platform-tests that I'd prefer someone else to take on.
Technically no need for MessageChannel.
I've been following this silently so far and I'm all for investigating the use of MessagePort. I just want to throw out an opinion that in terms of frequency, this kind of messaging will typically occur only when the application wants to change an attribute or invoke an operation on a node. It doesn't happen on every render quantum. I am not sure if the concerns about GC are taking this usage profile into account, but maybe it's a legit concern even if the messaging is not so frequent.
If something is possible, it will be abused.
In any case, we have been chatting about this in https://github.com/w3c/css-houdini-drafts/issues/380, and it validates the plan laid out in https://github.com/WebAudio/web-audio-api/issues/1194#issuecomment-294177022.
From WG call today: @hoch is going to pursue the MessagePort/postMessage approach since it leverages existing spec work. If there are performance problems from GC, they can emerge and be measured.
I believe the intention here was to specifically deliver any ondata's sent from the main thread directly before the process method is called for that node?
If so AudioWorkletProcessor shouldn't have
ondata
being aEventHandler
just a callback similar toprocess
.