ResourceFaçade

ResourceFaçade

ResourceFaçade is a thin IPC façade for actual resource running in a separate process. Constructor requires actual job instance just to instantiate a resource from its createResource call, separate run call is required to start it.

Constructor

new ResourceFaçade(job, file)

Source:

Constructor

Parameters:
Name Type Description
job Job

for resource

file string

Members

isBusy

Source:

Check if resource is busy

isReady

Source:

Check if resource is ready

Methods

abort(job) → {Promise}

Source:

Abort job

Parameters:
Name Type Description
job Job

to abort

Returns:

promise

Type
Promise

canBeTerminated() → {boolean}

Source:

Whether manager is allowed to terminate process on master exit Uses opened event data to know if underlying resource can be terminated

Returns:

true if manager can;

Type
boolean

close() → {Promise}

Source:

Close resource

Returns:

promise

Type
Promise

kill() → {Promise}

Source:

Kill resource

Returns:

promise

Type
Promise

open() → {Promise}

Source:

Open resource

Returns:

promise

Type
Promise

reject(error)

Source:

Reject job

Parameters:
Name Type Description
error Error

with which to reject

resolve()

Source:

Resolve job

run(job) → {Promise}

Source:

Run job

Parameters:
Name Type Description
job Job

to run

Returns:

promise

Type
Promise