Skip to content

Process behaviour(fork, common/separate execution of code chunk, etc.) manager for Swint

License

Notifications You must be signed in to change notification settings

Knowre-Dev/swint-fork

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

swint-fork

Greenkeeper badge 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 instance
    • cb: callback when preProcess ended
  • postProcess: Function
    • fork: swint-fork instance
    • cb: callback when postProcess ended
  • onExit: Function, executed when child process died
  • numFork: Number, default: # of CPU logical core
  • operator: 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
			}
		})
	});

About

Process behaviour(fork, common/separate execution of code chunk, etc.) manager for Swint

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published