fork
A simple module that gives a clean request
/response
api for dealing with
a child_process
that you want to fork
. It comes with built
in retry support using back
for backoff to try and ensure determinism.
Works best when used with forkee
for the child process.
install
npm install fork --save
Example Usage
//// This could also just be a path but we encourage module use :)//var childToFork = require;var Fork = ;//// Specify retries and backoff (useful for network based operations);//var message = action: 'start' whatever: 'blahblah' ; var fork = path: childToFork retries: 3 backoff: true ; //// If the `forkee` child process sends an event, it gets emit on the `fork` instance.// If the forkee instance sent a `website:fetched` message//fork; //// You can also use a simple callback api on the `start`/`fork` method!//var fork2 = childToForkstartmessage { if err return console; consoledirreturnMessage;};