Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Does not work with SharedWorker #21

Open
bryaan opened this issue Apr 20, 2023 · 2 comments
Open

Does not work with SharedWorker #21

bryaan opened this issue Apr 20, 2023 · 2 comments

Comments

@bryaan
Copy link

bryaan commented Apr 20, 2023

This lib does not work for Shared WebWorkers.

const worker = new WebworkerPromise(new SharedWorker('worker.ts'));

dex.js:67 Uncaught (in promise) TypeError: this._worker.postMessage is not a function
    at index.js:67:20
    at new Promise (<anonymous>)
    at Worker.postMessage (index.js:64:12)
 
@kwolfy
Copy link
Owner

kwolfy commented Apr 24, 2023

SharedWorker has a significantly different interface than regular Workers. I think in theory it is possible to implement support for them, but it requires significant improvements

@kwolfy
Copy link
Owner

kwolfy commented Apr 24, 2023

I have a plan to implement a more universal library with support for node thread_workers, ServiceWorkers, SharedWorkers. But I can't predict when it will be ready yet

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants