A small multi-threaded C++ library (so, does not include any main) compiled with emscripten and pthread running under the main thread in the browser, a web worker or using node.js
.
Note: Emscripten will produce lib.js
.
Running this lib in the main thread is fine but, obviously, block the main thread. Running it using a web worker leads no error with modification of the worker script (see below)
Run fine except that it prevents Node app from ever exiting.
at 28 line
https://gist.github.com/xaliphostes/6869989fadfb055ea40c2987b1150549#file-worker-js-L28
Did you try to put Lib inside
LibModule(Lib).then( lib => {
?