The first of the two commits gets to a working version that has stability problems on Chrome (due to crbug 775952) because of leaks when terminating workers, but is a very clean patch to glucose.
The second commit moves to a model where there is a single worker that handles all requests, including requests to cancel the current problem. It uses the asyncify feature of emscripten to return control periodically to the JavaScript main loop so that it has the opportunity to receive the cancel request.
The first of the two commits gets to a working version that has stability problems on Chrome (due to crbug 775952) because of leaks when terminating workers, but is a very clean patch to glucose.
The second commit moves to a model where there is a single worker that handles all requests, including requests to cancel the current problem. It uses the asyncify feature of emscripten to return control periodically to the JavaScript main loop so that it has the opportunity to receive the cancel request.