Skip to content

Comparisons

Compare ciorent with other concurrency libraries.

Control the amount of tasks running concurrently.

  • Bundle size: 998B
  • Minified size: 518B
  • Gzipped size: 346B
import { semaphore } from 'ciorent';
import { setTimeout } from 'node:timers/promises';
const sem = semaphore.init(2);
const asyncTask = async () => {
await semaphore.acquire(sem);
await setTimeout(5);
semaphore.release(sem);
};
for (let i = 0; i < 100; i++) asyncTask();