A concurrency-limited async task queue. At most simultaneous tasks run at once; the rest
wait, and a slot is refilled as each one finishes. Use it for batch uploads or batch requests:
anything you cannot fire all at once.
import { QuestQueue } from 'ranuts';const queue = new QuestQueue({ simultaneous: 3 });const results = await Promise.all(urls.map((url) => queue.add(() => fetch(url))));// Or fire and forget, then wait for everything including failuresurls.forEach((url) => queue.add(() => fetch(url)).catch(report));await queue.onIdle();