Files
react-native-devtools-frontend/node_modules/workerpool/examples/browser/offloadFunctions.html
T
Peter Marshall 0b95ea162f Update Mocha to 8.0.1
Breaking changes here https://github.com/mochajs/mocha/releases/tag/v8.0.0
seem fine.

DISABLE_THIRD_PARTY_CHECK=Update Mocha

Bug: chromium:1101784
Change-Id: Idc75c94f9a923e2b0ca13d1d1331540cb1c5d3a3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2279830
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
2020-07-03 09:50:38 +00:00

31 lines
579 B
HTML

<!DOCTYPE html>
<html>
<head>
<title>Worker pool in the browser</title>
<script src="../../dist/workerpool.min.js"></script>
</head>
<body>
<script>
// create a worker pool
var pool = workerpool.pool();
// create a static function
function add(a, b) {
return a + b;
}
// offload execution of a function to the worker pool
pool.exec(add, [3, 4])
.then(function (result) {
document.write('Result: ' + result); // outputs 7
})
.catch(function (err) {
document.write('Error: ' + err);
});
</script>
</body>
</html>