1.2.11 • Published 7 years ago
swint-fork v1.2.11
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-forkOptions
preProcess:Functionfork: swint-fork instancecb: callback whenpreProcessended
postProcess:Functionfork: swint-fork instancecb: callback whenpostProcessended
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
}
})
});