Manager

Manager

Manager obviously manages jobs running: monitors jobs collection & IPC messages, runs jobs dividing then if necessary, starts and manages corresponding resources and reports jobs statuses back to the one who started them: IPC or jobs collection.

Constructor

new Manager()

Source:

Constructor

Members

ipc

Source:

get ipc

Methods

canRun(job, count) → {boolean}

Source:

Check if can run the job

Parameters:
Name Type Description
job Job

job to run

count number

number of times to run

Returns:

if can run job

Type
boolean

check()

Source:

Check if job is scheduled

checkAfterDelay(delay)

Source:

Check if job is scheduled after delay

Parameters:
Name Type Description
delay number

delay to wait before checking

create(json) → {Job}

Source:

Create job from json

Parameters:
Name Type Description
json object

json object defining job

Returns:

job

Type
Job

getPool(job) → {object}

Source:

Get resource pool for job

Parameters:
Name Type Description
job Job

job

Returns:

resource pool

Type
object

getResource(job) → {object}

Source:

Get resource for job

Parameters:
Name Type Description
job Job

job

Returns:

resource

Type
object

hasResources(job) → {boolean}

Source:

Check resource for running job

Parameters:
Name Type Description
job Job

job

Returns:

if can has resource

Type
boolean

job(name, data) → {Job}

Source:

create job instance

Parameters:
Name Type Description
name string

job name

data object

data about job

Returns:

job

Type
Job

(async) process(jobs)

Source:

Process jobs

Parameters:
Name Type Description
jobs array

= array with jobs

run(job) → {Promise}

Source:

Run any job with handling retries if necessary. Returns a promise.

Parameters:
Name Type Description
job Job

job to run

Returns:

promise

Type
Promise

runIPC(job) → {Promise}

Source:

Run job by creating IPCFaçadeJob with actual job: instantiate or pick free resource, run it there. Returns a promise.

Parameters:
Name Type Description
job IPCJob

job to run

Returns:

promise

Type
Promise

runLocally(job) → {Promise}

Source:

Run instantiated Job locally. Returns a promise.

Parameters:
Name Type Description
job Job

job to run

Returns:

promise

Type
Promise

schedule(job) → {Promise}

Source:

Schedule job

Parameters:
Name Type Description
job Job

job to schedule

Returns:

promise

Type
Promise

start(job) → {Promise}

Source:

Run job

Parameters:
Name Type Description
job Job

job to run

Returns:

promise

Type
Promise