new Launchers.ChildProcess(options)
Create a new child process worker using child_process.fork
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
options or name of script to execute
|
||||||||||||
...args |
Any arguments to pass to the script |
Methods
-
emit(event, data, callback)
launchers/childprocess.js, line 60 -
Send a message to the worker process
Name Type Description eventstring Name of the event to send
dataany What data to send
callbackfunction Callback called when complete
-
kill(signal)
launchers/childprocess.js, line 51 -
Terminates the child process with signal
Name Type Default Description signalstring SIGTERM Signal to send to child process, defaults to 'SIGTERM'
-
on(event, handler)
launchers/childprocess.js, line 75 -
Setup a listener for an event. Called every time the worker gets the event.
Name Type Description eventstring What even to listen for
handlerfunction function(data, done) handler for the event
Name Type Description dataany Data to be processed
donefunction Function to return results to the manager
-
once(event, handler)
launchers/childprocess.js, line 83 -
Setup a listener for an event. Called only once, then removed.
Name Type Description eventstring What even to listen for
handlerfunction function(data) handler for the event
-
send()
launchers/childprocess.js, line 90 -
Private internal, used to actually send messages back to the master process. See Node.js documentation for process.send for more info.