yyx990803 / okie

Dead simple worker threads pool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Okie

"Okie dokie, work work"

Dead simple worker threads pool.

const { Worker } = require('okie')

const worker = new Worker(n => n + 1, {
  max: 3 // defaults to os.cpus().length - 1
})

;(async () => {
  const result = await worker.run(1)
  console.log(result) // logs "2"

  worker.stop()
})()

About

Dead simple worker threads pool

License:MIT License


Languages

Language:TypeScript 83.6%Language:JavaScript 16.4%