josdejong / workerpool

Offload tasks to a pool of workers on node.js and in the browser
Apache License 2.0
2.06k stars 147 forks source link

how to use FileReaderSync in workerpool #393

Closed Ljy66 closed 1 year ago

Ljy66 commented 1 year ago

Hello!Recently I wanted to use workerpool to parse uploaded large files. Do you have an example to refer to if possible? Thank you!

josdejong commented 1 year ago

There is no example of that. Feel free to share an example here when you've implemented this, that may help others 😄.

Basically: you'll have to run FileReaderSync in the main thread, send the loaded text data to a worker, and do your parsing step there.

Ljy66 commented 1 year ago

Ok, I will try it myself. Thank you for your reply