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

3.0.0 • Public • Published

piscina-priority-queue - A Priority Queue for Piscina

CI

Example

const Piscina = require('piscina');
const PiscinaPriorityQueue = require('piscina-priority-queue');
const { resolve } = require('path');

const pool = new Piscina({
  filename: resolve(__dirname, 'worker.js'),
  taskQueue; new PiscinaPriorityQueue()
});

const priority_1_task = PiscinaPriorityQueue.makeTask({ a: 1 }, 1);
const priority_2_task = PiscinaPriorityQueue.makeTask({ a: 1 }, 2);

(async () => {
  await Promise.all([
    pool.runTask(priority_1_task),
    pool.runTask(priority_2_task)
  ]);
})();

The Team

Acknowledgements

Piscina development is sponsored by NearForm Research.

Readme

Keywords

Package Sidebar

Install

npm i piscina-priority-queue

Weekly Downloads

6

Version

3.0.0

License

MIT

Unpacked Size

16.9 kB

Total Files

17

Last publish

Collaborators

  • jasnell
  • metcoder95