Skip to content
Snippets Groups Projects
Commit c8f96427 authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

web workers

parent 112711df
No related branches found
No related tags found
No related merge requests found
//global workers so they do not have to be reinstantiated
function makeWorkers(){
function makeURL(myWorkerFunction) {
var URL = window.URL || window.webkitURL;
var blob = new Blob([myWorkerFunction.toString()], { type: "text/javascript" });
return URL.createObjectURL(blob);
}
function workerFunction(){
// var isNode = typeof module !== 'undefined' && module.exports;
//
// if (isNode) {
// process.once('message', function (code) {
// eval(JSON.parse(code).data);
// });
// } else {
console.log("eval");
self.onmessage = function (code) {
console.log(code);
eval(code.data);
};
// }
}
return new Parallel(null, {env:null, evalPath: "dependencies/eval.js"}).require('three.js');
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment