swint-fork
v1.2.11
Published
Process behaviour(fork, common/separate execution of code chunk, etc.) manager for Swint
Downloads
235
Readme
swint-fork
Process behaviour(fork, common/separate execution of code chunk, etc.) manager for Swint
Warning: This is not the final draft yet, so do not use this until its official version is launched
Installation
$ npm install --save swint-fork
Options
preProcess
:Function
fork
: swint-fork instancecb
: callback whenpreProcess
ended
postProcess
:Function
fork
: swint-fork instancecb
: callback whenpostProcess
ended
onExit
:Function
, executed when child process diednumFork
:Number
, default: # of CPU logical coreoperator
: swint-proc-ops instance, default:null
Usage
var fork = swintFork({
preProcess: function(fork, cb) {
cb({
foo: 'bar'
});
},
postProcess: function(fork, sharedData, cb) {
print(sharedData.foo);
cb({});
},
onExit: function(fork) {
print('process killed');
},
operator: swintProcOps({
server: {
enabled: true
},
keyBind: {
enabled: true
}
})
});