Command

Represents a command running in a sub-process.

Constructor

new Command(resultnon-null, onKill)

Parameters:
NameTypeDescription
resultPromise.<!Result>

The command result.

onKillfunction

The function to call when #kill() is called.

Methods

getName() → {string}

Returns:

This command's name.

Type: 
string

getParameter(key) → {*}

Returns a named command parameter.

Parameters:
NameTypeDescription
keystring

The parameter key to look up.

Returns:

The parameter value, or undefined if it has not been set.

Type: 
*

getParameters() → (non-null) {Object.<*>}

Returns:

The parameters to send with this command.

Type: 
Object.<*>

kill(opt_signalopt)

Sends a signal to the underlying process.

Parameters:
NameTypeAttributesDescription
opt_signalstring<optional>

The signal to send; defaults to SIGTERM.

result() → (non-null) {Promise.<!Result>}

Returns:

A promise for the result of this command.

Type: 
Promise.<!Result>

setParameter(name, value) → (non-null) {Command}

Sets a parameter to send with this command.

Parameters:
NameTypeDescription
namestring

The parameter name.

value*

The parameter value.

Returns:

A self reference.

Type: 
Command

setParameters(parametersnon-null) → (non-null) {Command}

Sets the parameters for this command.

Parameters:
NameTypeDescription
parametersObject.<*>

The command parameters.

Returns:

A self reference.

Type: 
Command

Command

Describes a command to execute.

Constructor

new Command(name)

Parameters:
NameTypeDescription
namestring

The name of this command.

Methods

getName() → {string}

Returns:

This command's name.

Type: 
string

getParameter(key) → {*}

Returns a named command parameter.

Parameters:
NameTypeDescription
keystring

The parameter key to look up.

Returns:

The parameter value, or undefined if it has not been set.

Type: 
*

getParameters() → (non-null) {Object.<*>}

Returns:

The parameters to send with this command.

Type: 
Object.<*>

kill(opt_signalopt)

Sends a signal to the underlying process.

Parameters:
NameTypeAttributesDescription
opt_signalstring<optional>

The signal to send; defaults to SIGTERM.

result() → (non-null) {Promise.<!Result>}

Returns:

A promise for the result of this command.

Type: 
Promise.<!Result>

setParameter(name, value) → (non-null) {Command}

Sets a parameter to send with this command.

Parameters:
NameTypeDescription
namestring

The parameter name.

value*

The parameter value.

Returns:

A self reference.

Type: 
Command

setParameters(parametersnon-null) → (non-null) {Command}

Sets the parameters for this command.

Parameters:
NameTypeDescription
parametersObject.<*>

The command parameters.

Returns:

A self reference.

Type: 
Command