Class: CallableTask

tasks/CallableTask~CallableTask

new CallableTask()

CallableTask interact with the forked script

Source:

Extends

Methods

call()

Call a script method without expecting an answer

Parameters:
Name Type Description
...arguments Mixed
Source:
Returns:

Promise resolve when message has reach destination

get() → {Promise.<...data>}

Get a script property, expecting an answer.

The Callable Container is handling functions, promises and simple getters

Parameters:
Name Type Description
...arguments Mixed
Source:
Returns:

resolves on answer

Type
Promise.<...data>

kill(signal)

Kill sends a signal to the Task

Parameters:
Name Type Description
signal Number
Inherited From:
Source:
See:
  • ChildProcess#signal

onError(error, stack)

Error event listener

Parameters:
Name Type Description
error String

message

stack String

stack trace

Inherited From:
Source:
Listens to Events:
  • module:tasks/ScriptTask~ScriptTask#event:error

onExit(code)

Exit event listener

Parameters:
Name Type Description
code Number

the exit code

Inherited From:
Source:
Listens to Events:

restart() → {Promise}

Restart the Task

Inherited From:
Source:
Returns:

resolves when restarted

Type
Promise

send(event)

Childprocess.send wrapper

Parameters:
Name Type Description
event String
...args Arguments
Inherited From:
Source:
Throws:
ReferenceError
Returns:

Promise

start(args) → {Promise}

Start the Task

Parameters:
Name Type Description
args Arguments

Arguments for the child_process

Inherited From:
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
Inherited From:
Source: