Perform async work synchronously using web worker and SharedArrayBuffer
Hi! ๐ Firstly, thanks for your work on this project! ๐ Today I used [patch-package](https://github.com/ds300/patch-package) to patch `[email protected]` for the project I'm working on. <!-- ๐บ๏ธ๐บ๏ธ๐บ๏ธ PLEASE REPLACE THIS BLOCK with a description of your problem, and any other relevant context ๐บ๏ธ๐บ๏ธ๐บ๏ธ --> Here is the diff that solved my problem: ```diff diff --git a/node_modules/await-sync/mod.js b/node_modules/await-sync/mod.js index 7bb40b0..e13b25a 100644 --- a/node_modules/await-sync/mod.js +++ b/node_modules/await-sync/mod.js @@ -20,6 +20,8 @@ function createWorker (signal) { return function awaitSync (fn, formatter) { const source = 'export default ' + fn.toString() const mc = new MessageChannel() + mc.port1.unref?.() + mc.port2.unref?.() const localPort = mc.port1 const remotePort = mc.port2 worker.postMessage({ port: remotePort, code: source, ab }, [remotePort]) ``` <em>This issue body was [partially generated by patch-package](https://github.com/ds300/patch-package/issues/296).</em>
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by jcbhmr and has received 1 comments.