aboutsummaryrefslogtreecommitdiff
path: root/04_no_block/worker.mjs
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-06-05 10:13:28 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-06-05 10:13:28 +0200
commit73efecca42dbc44200e797e02f8c1e24fcff26ef (patch)
tree46969fed9d5c09a4164257dace56a71cad9092ab /04_no_block/worker.mjs
parent2a8e7aeeef99161b6f0378ac14e297c23ca6227b (diff)
downloademscripten-tutorial-73efecca42dbc44200e797e02f8c1e24fcff26ef.tar.gz
emscripten-tutorial-73efecca42dbc44200e797e02f8c1e24fcff26ef.zip
Added two more examples
Diffstat (limited to '')
-rw-r--r--04_no_block/worker.mjs8
1 files changed, 8 insertions, 0 deletions
diff --git a/04_no_block/worker.mjs b/04_no_block/worker.mjs
new file mode 100644
index 0000000..6476203
--- /dev/null
+++ b/04_no_block/worker.mjs
@@ -0,0 +1,8 @@
1import Primes from "./build/primes.mjs";
2
3var primes = await Primes();
4
5onmessage = (e) => {
6 const count = primes._primes_in_range(e.data.a, e.data.b);
7 postMessage({ result: count, a: e.data.a, b: e.data.b });
8};

Generated with cgit - Back to sebastiano.tronto.net