Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
/ fork-pool Public archive
forked from thisandagain/fork-pool

A generic child process pool for Node.js.

License

Notifications You must be signed in to change notification settings

EverFi/fork-pool

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A generic child process pool for Node.js.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%