if(!this._handleMessage.length&&this._unemployed.length){// get an unemployed workervar workerID = this._unemployed.shift().substring(1); // remove _// list this worker as employedthis._employed["_" + workerID] = callback;
// do the workethis._manager.sendMessage(msg, workerID);
}else{// we have to queue it upthis._handleMessage ={msg: msg, callback: callback};
}