-
Notifications
You must be signed in to change notification settings - Fork 13
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
Extend the library to more use cases #46
Comments
Audio Worklet support would be nice. It seemed to hang on the handshake when I tried it. Of course, I could've made a mistake |
@grahamlyus Do you have a small repo/gist to provide with your attempts at using post-me with the worklet? |
@alesgenova I'll try to get an minimal example going this week. |
@alesgenova It works! I modified your demo repo: grahamlyus/post-me-demo@5564993 The big caveat is that the AudioWorklet must use the I also added a contrived example where the Parent connects the Worker and AudioWorklet via I think maybe where I tripped up before was possibly making the |
@grahamlyus Really glad to hear it worked out! I checked out your demo, it's a pretty cool setup with the worker/worklet directly connected over the channel, and I'm quite relieved it actually worked! :) Btw, methods can return either values or promises, it shouldn't make a difference to the library. Good find, I didn't consider that some contexts might not have If you don't have time, I can probably get around to adding it some time over the weekend. |
@alesgenova I dropped it into my project and it all seems to still be working well. I'm experimenting with audio processing with WebAssembly. The Web Worker is used to download and decode chunks of an audio stream on demand when the Audio Worklet asks for them, as the I can try adding a small readme section for Audio Worklet usage it that sounds good. |
Sounds good to me, I think it's a cool use case |
The utilities provided by post-me can be useful for any use case in which there is only one low level channel of communication (similar to postMessage).
By adding more classes implementing the
Messenger
interface (and possibly extending theMessenger
interface if needed) we can directly support more scenarios.Just a couple of example that come to mind:
MessageChannels[Add support for MessageChannel/MessagePort #47 ]The text was updated successfully, but these errors were encountered: