//提取邮箱 function pickmail(obj,callback){ var jval = $(obj); //
$("#dopickmail").on('click',function(){
//显示邮内容:
var jitems =[];
$(HTML_ID_SEARCHDATA).find('td[colspan="2"]').each(function(index, val) {
jitems.append(val);
});
var q = async.queue(function(obj,pick,callback){
pick(obj,callback);
},3);
/**
* 监听:如果某次push操作后,任务数将达到或超过worker数量时,将调用该函数
*/
q.saturated = function() {
$(HTML_ID_MSGTXT).text('all workers to be used'+q.length());
}
/**
* 监听:当最后一个任务交给worker时,将调用该函数
*/
q.empty = function() {
$(HTML_ID_MSGTXT).text('no more tasks wating');
}
/**
* 监听:当所有任务都执行完以后,将调用该函数
*/
q.drain = function() {
$(HTML_ID_MSGTXT).text('all tasks have been processed');
}
$.each(jitems,function(index,value){
q.push(value,pickmail,function(err){});
});
});
//end 提取
回到顶部