顺序的执行 async 回调任务

const sleep = (time, val) =>  new Promise(rs => setTimeout(() => rs(val), time));
const seq = new Sequencer();
let i = 0;
for(let b =0; b < 100; b++) seq.queue(() => sleep(100, ++i).then(d => console.log(d)));

Constructors

Methods

Constructors

Methods