We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Usage
const dohMathSync = api.doMathAsync.bind(api)
main.mjs
import { Worker } from 'worker_threads' import * as Comlink from 'comlink' import { Endpoint } from 'synckit' const worker = new Worker(new URL('./worker.mjs', import.meta.url)) const api = Comlink.wrap(Endpoint(worker)) const dohMathSync = api.doMathAsync.bind(api)
worker.mjs
import { parentPort } from 'worker_threads' import * as Comlink from 'comlink' import { Endpoint } from 'synckit' const api = { async doMathAsync() { return 4 } } Comlink.expose(api, Endpoint(parentPort))
Related
GoogleChromeLabs/comlink#642
The text was updated successfully, but these errors were encountered:
No idea what's your meaning, please describe it in details.
Sorry, something went wrong.
Close in favor of #140
No branches or pull requests
Usage
main.mjs
worker.mjs
Related
GoogleChromeLabs/comlink#642
The text was updated successfully, but these errors were encountered: