new ScriptTask(script, options)
ScriptTask takes a module path and runs it in a container
Parameters:
Name | Type | Description |
---|---|---|
script |
String | the path of the script |
options |
Object |
Properties:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
channel |
ChildProcess | the ipcee channel |
||||||||||||||||||||||||||
name |
String |
<optional> |
uuid.v4 | the task name |
||||||||||||||||||||||||
options |
Object | Task options Properties
|
||||||||||||||||||||||||||
|
Extends
- IPCEE
Methods
kill(signal)
Kill sends a signal to the Task
Parameters:
Name | Type | Description |
---|---|---|
signal |
Number |
- Source:
- See:
-
- ChildProcess#signal
onError(error, stack)
Error event listener
Parameters:
Name | Type | Description |
---|---|---|
error |
String | message |
stack |
String | stack trace |
- Source:
Listens to Events:
- module:tasks/ScriptTask~ScriptTask#event:error
onExit(code)
Exit event listener
Parameters:
Name | Type | Description |
---|---|---|
code |
Number | the exit code |
- Source:
Listens to Events:
restart() → {Promise}
Restart the Task
- Source:
Returns:
resolves when restarted
- Type
- Promise
send(event)
Childprocess.send wrapper
Parameters:
Name | Type | Description |
---|---|---|
event |
String | |
...args |
Arguments |
- Source:
Throws:
ReferenceError
Returns:
Promise
start(args) → {Promise}
Start the Task
Parameters:
Name | Type | Description |
---|---|---|
args |
Arguments | Arguments for the child_process |
- Source:
Listens to Events:
- event:exit
Throws:
-
if already running
- Type
- ReferenceError
Returns:
resolve when Task emits start
- Type
- Promise
Events
exit
Properties:
Name | Type | Description |
---|---|---|
code |
Number |
- Source: