An open API service indexing awesome lists of open source software.

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

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
```