You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

fork-pool

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fork-pool

A generic child process pool for Node.js

2.0.0
latest
Source
npmnpm
Version published
Weekly downloads
53
-8.62%
Maintainers
1
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 18 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts