Created
November 16, 2009 15:04
-
-
Save corbanbrook/236044 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = ""; | |
var activeSubworkers = 0; | |
if ( typeof(options.workerpath) == 'string' || options.workerpath instanceof String ) { | |
path = options.workerpath; | |
} | |
var worker = new Worker(path + "metaworker.js"); | |
worker.onmessage = function(event) { | |
var callbackData = event.data; | |
if ( callbackData.type=='data' ) { | |
options.callback(callbackData.payload); | |
} else if ( ({'log':true,'debug':true,'dir':true}).hasOwnProperty(callbackData.type) ) { | |
console[callbackData.type].apply(this,callbackData.payload); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment