0.1.0 • Published 2 years ago

piscina-microjob v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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