Class: ScriptTask

tasks/ScriptTask~ScriptTask

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
Name Type Description
restart Boolean

Restart when exit

restartDelay Number

Delay before restart

container String

Base Container

containers Array

An array of additional containers

eventemitter Object

Eventemitter2 options

childprocess Object

childprocess.Fork options

interfaces Object

Javascript prototype which grasp on the Task prototye

Source:
See:

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:
Listeners of This Event: