josdejong / josdejong/workerpool

How to bundle and embed a dedicated worker which uses libraries in a web application?

Open
#189 2 comments 4 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
2.3k
Forks
164
PR merge metrics
No merged PRs in 30d

Description

I am trying to integrate workerpool with a Reactjs app (CRA) but am having quite a few different issues depending on how I try to achieve it. Using it with the Node part is no problem but I think more info is needed on the "browser" side of the repos.

By looking around I found https://github.com/josdejong/workerpool/issues/43 where Jos was kind enough to provide a basic example (https://codesandbox.io/s/xz9jwnyvrw). Issue is, in a real app you probably won't have a simple function placed in index.js that does not need any external librairies

1) How can I define a seperate worker using its own external librairies and use it in index.js? using `var pool = workerpool.pool('/path/to/worker.js')` then `pool.exec('function')` as suggested in another thread did not work

2) Can workerpool used for the browser only be integrated in the way described here https://github.com/josdejong/workerpool/blob/master/examples/browser?

I would appreciate a realistic example of integrating workerpool with a React app, maybe by updating the codesandbox to use an imported worker with its own librairies?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.