fork-pool

2.0.0 • Public • Published

Fork-Pool

Build Status

Installation

npm install fork-pool

Basic Use

// Parent process
var Pool    = new pool(__dirname + '/child.js', null, null, {});
Pool.enqueue('hello', function (err, obj) {
    console.dir(obj);   // FTW!
});
// Child process
process.on('message', function (message) {
    process.send('world');
});

Parameters

  • path: Child process path (generally, you will want to prefix with "__dirname")
  • args: Child process arguments
  • options: Child process options
  • settings: Pool settings
    • name (Optional, Defaults to "fork-pool")
    • size (Optional, Defaults to # of CPUs)
    • log (Optional, Defaults to false)
    • timeout (Optional, Defaults to 30000ms)

Testing

npm test

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    254
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.0
    254
  • 0.0.2
    39
  • 0.0.1
    3

Package Sidebar

Install

npm i fork-pool

Weekly Downloads

20

Version

2.0.0

License

none

Last publish

Collaborators

  • diy