Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yyx990803/okie
Dead simple worker threads pool
https://github.com/yyx990803/okie
Last synced: 6 days ago
JSON representation
Dead simple worker threads pool
- Host: GitHub
- URL: https://github.com/yyx990803/okie
- Owner: yyx990803
- License: mit
- Created: 2020-12-20T20:33:07.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-08-10T11:03:20.000Z (over 1 year ago)
- Last Synced: 2024-10-27T03:48:48.828Z (16 days ago)
- Language: TypeScript
- Size: 63.5 KB
- Stars: 263
- Watchers: 13
- Forks: 15
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Okie
> "Okie dokie, work work"
Dead simple worker threads pool.
```js
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()
})()
```