developit/workerize-loader

Support for async generators

egriff38 opened this issue · 2 comments

Hello,
I was wondering how feasable it would be to add async generator support to web workers? I think using async function* and for await() would be an absolutely astounding way to utilized workers as streams rather than just one-off async functions. The hardest part I would imagine would be facilitating the connection between a specific generator instance in the worker vs the main thread.

Just a note - comlink-loader is available and handles async generators in addition to most other interfaces. It's API is pretty similar to this loader.

Looks great. Thanks!