Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NodeJS bindings - worker threads error demo #47

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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");