i can't find a way to use the sqlite3 in a web worker in Node.js, i use this library for Node.js
https://github.com/mapbox/node-sqlite3
https://github.com/audreyt/node-webworker-threads
and this is the code:
var Worker = require('webworker-threads').Worker;
var worker = new Worker(function(){
postMessage("I'm working before postMessage('ali').");
this.onmessage = function(event) {
console.log("before sqlite3");
var sqlite3 = require('sqlite3').verbose();
var db = new sqlite3.Database('MyDB.db');
console.log("after sqlite3");
};
});
worker.postMessage('test');
this is the output:
before sqlite3
and block there, how i can use sqlite3 in the web worker?