1.0.0 • Published 2 years ago

oker-limit v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

oker-limit

API

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);