1.0.5 • Published 5 months ago

@ringkasan.net/queuebatch v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

Usage:

async function dummyProcess(d:any): Promise<any> {
  return new Promise(resolve => { 
    setTimeout(() => {
      resolve(`Task completed ${d} `);  
    }, 1000);
  });
}
async function dummyProcess2(d:any): Promise<any> {
  return new Promise(resolve => { 
    setTimeout(() => {
      resolve(`Task completed dummy2 ${d} `);  
    }, 1000);
  });
}
console.log(QueueProcessor);
const queueProcessor = new QueueProcessor();
queueProcessor.addProcessor(dummyProcess,2);
queueProcessor.addProcessor(dummyProcess2,1);

const buffer=queueProcessor.addDataToBuffer(i);
buffer.then((res) => {
  console.log('result:', JSON.stringify(res));
});
1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago