import { workers } from 'moroutine'; import { busy } from './load-balancing.ts'; // Dispatches CPU-bound tasks on a dedicated worker, then on a pool. // The process should complete and print DONE; if pool workers // are unref'd the event loop may exit early (exit code 13). await busy(10); { using run = workers(2); const results = await run([busy(50), busy(50), busy(50)]); console.log('DONE ' + results.join(',')); }