-
Notifications
You must be signed in to change notification settings - Fork 11
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
Implement EventTarget interface #61
Conversation
One thing that I found that is more a concern on the rust side, is that the first "resume" I will try to make a failing test for that later |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks quite complicated but I guess this is due to the fact that NodeJs has no JS-alike event targets?
src/audio_context.rs
Outdated
// We need to clean things around so that the js object can be garbage collected. | ||
// But we also need to wait so that the previous tsfn.call is executed, | ||
// this is not clean, but don't see how to implement that properly right now. | ||
std::thread::sleep(std::time::Duration::from_millis(100)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope this hack is only needed for the onStateChange event? Or also for other types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum no it seems to be required for other types as well, need to investigate further
I could make a start with orottier/web-audio-api-rs#410 where the whole thing will be rewritten anyway |
Actually, this is quite boring because there is a compliant A solution is described here, but this is something internal to Node and the given "trick" is not exposed... so we have work around somehow... Maybe I could try to open an issue on the Node repo to see if there is a solution I didn't find |
I don't really understand why I have less tests working than you... but that was already the case before
Could you run the wpt see what you get? In any case, there is already a lot (too much) done in this PR, I will merge once orottier/web-audio-api-rs#415 is released if ok for you |
The wpt submodule is out of date on your end I think, and this was accidentally merged into main over at fd4d710 I will push the correct version and I think you should then run I now notice we have a fatal wpt crash at
So I don't have the results right now, will look into it later today |
I have just released v0.40.0 for you |
Thanks! Seems that it was the wpt that was not up to date indeed. For the error you encounter, I don't really understand this works well on my side. But I have seen yesterday that building in debug mode could create weird errors and crashes with wpt, I updated the wpt script ( Updated results on my side are:
|
Just another try compared to #52
Tried to follow your idea, seems a bit better to me indeed but there are still some convoluted things I didn't find how to work around (no big deal though, it works... :)
Note that it depends on 415(merged)List of all events in the spec:
OfflineAudioContext::state
is not updated when callingsupend
andresume
orottier/web-audio-api-rs#416)todo later