Skip to content

Instantly share code, notes, and snippets.

@wadez
Last active June 13, 2021 17:38
Show Gist options
  • Save wadez/84259e25bff43f966c72b2d6d9b361e4 to your computer and use it in GitHub Desktop.
Save wadez/84259e25bff43f966c72b2d6d9b361e4 to your computer and use it in GitHub Desktop.
const Pool = require("jpool")
const path = require("path")
var jobs = 30;
const pool = new Pool({threads: 8})
for (var i = 0; i < jobs; i++) {
pool.add(path.resolve(__dirname, 'jobs/findRandomNumber.js'))
}
pool.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment