piscina-microjob
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

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

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

Package Sidebar

Install

npm i piscina-microjob

Weekly Downloads

2

Version

0.1.0

License

MIT

Unpacked Size

3.64 kB

Total Files

7

Last publish

Collaborators

  • darrrk