-
Notifications
You must be signed in to change notification settings - Fork 131
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
Include an example for WebUSB use in Dedicated Workers #161
Comments
This change updates the steps for claimInterface() and releaseInterface() so that calls requesting the state that the device is already in cause the Promise returned to be resolved without any further action taken. Fixes WICG#161.
Do WebUSB workers work (in Chrome)? I tried it (in 2022), and it didn't. |
@7ombie, we have test cases for Dedicated Worker support in Web Platform Tests so it should work. Note that you cannot call |
Thank you, @reillyeon. That's almost certainly where I went wrong. I'm working with realtime audio, so really wanted a dedicated thread for the incoming USB that shares memory (a ring-buffer) with an audio worklet. Handling isochronous USB on the main thread was never going to work as well. |
I have implemented a system (currently undergoing internal Engineering Review and not publicly available, sorry) which uses a Worker for device communications. As mentioned above, the The issue is you can't pass the device object over a message to the Worker so currently I am passing the index of the selected device from the |
Agreed that it is currently hard to communicate between a document and worker about what device the user has selected. One option is to make the The other option is to implement an |
I don't think anything needs to change in the algorithms to support Web Workers but we should add a worker example to the spec. I don't think we have to do that in this patch. Wait until we've added a worker to an existing WebUSB app and have a sense of the best practices.
Originally posted by @reillyeon in #130
The text was updated successfully, but these errors were encountered: