import { OkerQueue } from 'oker-limit';
const queue = new OkerQueue<number>();
queue.push(1);
queue.pop();
queue.clear();
queue.size;
const a = [...queue]; // [1]
import { OkerLimit } from 'oker-limit';
// The maximum concurrency limit is 10
const limit = OkerLimit(10);
const promises = [];
for (const item of list) {
promises.push(
limit(() => yourTask(item))
);
}
await Promise.allSettled(limit);