Skip to content

Commit

Permalink
Worker thread error demo
Browse files Browse the repository at this point in the history
  • Loading branch information
dapplion committed Dec 14, 2020
1 parent 194c262 commit 8a8005e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,5 @@ jobs:
)
fi
fi
- name: Worker threads error
run: node bindings/node.js/worker-threads.js
2 changes: 1 addition & 1 deletion bindings/node.js/runnable.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

console.log("testing...");

const blst = require("blst");
const blst = require("./blst.node");

var msg = "assertion"; // this what we're signing
var DST = "MY-DST"; // domain separation tag
Expand Down
8 changes: 8 additions & 0 deletions bindings/node.js/worker-threads.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const { Worker } = require("worker_threads");

// Create two workers so blst.node is imported twice to trigger the error
// blst/bindings/node.js$ node worker-threads.js
// Error: Module did not self-register: 'blst/bindings/node.js/blst.node'.

const worker1 = new Worker("./runnable.js");
const worker2 = new Worker("./runnable.js");

0 comments on commit 8a8005e

Please sign in to comment.