1簡單寫個隊列模型const queue = { list: [], status: false, exec: (eventValue, next) => { listenerA(eventValue, next); // 這里綁定成你自己的處理函數(shù) 參見3. }, push: (eventValue) => { queue.list.push(eventValue); queue.start(); }, start: () => { if (!queue.status && queue.list.length) { queue.status = true; const params = queue.list.shift(); queue.exec(params, () => { queue.status = false; queue.start(); }); } }};2現(xiàn)在觸發(fā)事件不直接執(zhí)行函數(shù),而是推入隊列someObj.on('someEvent', queue.push);3處理函數(shù)加個next回調(diào),告知隊列本次執(zhí)行完畢了,開始執(zhí)行下一條function listenerA(eventValue, next) { // 查詢數(shù)據(jù)庫、寫數(shù)據(jù)庫等等操作 dbObj.query( eventValue, function (err, re