A minimalistic Node.js fork queue that schedules enqueued tasks and runs them in separate child processes using child_process.fork(). Version 0.1.34 is the latest stable release, with no active release cadence. Key differentiators: TypeScript-first, configurable queue size and parallelism, polling-based scheduler. Limited to forking Node.js modules; tasks must self-terminate via process.exit().
npm install ts-fork-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a ForkQueue with max 5 queued tasks and 2 parallel processes, starts the scheduler, and enqueues a task that forks a Node.js worker module.
Ensure each forked module calls process.exit() after completing its work, or the process will hang until the parent dies.
Wrap enqueue() in a try-catch block to handle queue full conditions.
Ensure maxQueueSize >= 1, maxParallelism >= 1, pollingPeriodSeconds > 0.
Use a reasonable polling interval, e.g. 2 seconds, to avoid excessive CPU load.
npm install ts-fork-queue
Use import { ForkQueue } from 'ts-fork-queue' or enable ESM in your project.Provide an object with all four methods returning strings.
No dependency data recorded yet.