https://github.com/darky/piscina-microjob
CPU bound routines over Piscina thread pool
https://github.com/darky/piscina-microjob
Last synced: 12 months ago
JSON representation
CPU bound routines over Piscina thread pool
- Host: GitHub
- URL: https://github.com/darky/piscina-microjob
- Owner: darky
- License: mit
- Created: 2022-05-16T17:49:28.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-09-03T14:21:07.000Z (almost 4 years ago)
- Last Synced: 2025-06-22T18:06:33.965Z (12 months ago)
- Language: TypeScript
- Size: 15.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# piscina-microjob
CPU bound routines over Piscina thread pool
Inspired by https://github.com/wilk/microjob, but uses https://github.com/piscinajs/piscina as thread pool
### Example
```typescript
import { threadPoolFactory } from 'piscina-microjob';
const thread = threadPoolFactory({
// ... https://github.com/piscinajs/piscina#class-piscina options can be passed
});
const resp = await thread(({n}) => n + 1, { n: 1 }, {
// https://github.com/piscinajs/piscina#method-runtask-options options can be passed
});
resp; // 2
```