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()

Description:
  • Constructor

Source:

Members

ipc

Description:
  • get ipc

Source:

get ipc

Methods

canRun(job, count) → {boolean}

Description:
  • Check if can run the job

Source:
Parameters:
Name Type Description
job Job

job to run

count number

number of times to run

Returns:

if can run job

Type
boolean

check()

Description:
  • Check if job is scheduled

Source:

checkAfterDelay(delay)

Description:
  • Check if job is scheduled after delay

Source:
Parameters:
Name Type Description
delay number

delay to wait before checking

create(json) → {Job}

Description:
  • Create job from json

Source:
Parameters:
Name Type Description
json object

json object defining job

Returns:

job

Type
Job

getPool(job) → {object}

Description:
  • Get resource pool for job

Source:
Parameters:
Name Type Description
job Job

job

Returns:

resource pool

Type
object

getResource(job) → {object}

Description:
  • Get resource for job

Source:
Parameters:
Name Type Description
job Job

job

Returns:

resource

Type
object

hasResources(job) → {boolean}

Description:
  • Check resource for running job

Source:
Parameters:
Name Type Description
job Job

job

Returns:

if can has resource

Type
boolean

job(name, data) → {Job}

Description:
  • create job instance

Source:
Parameters:
Name Type Description
name string

job name

data object

data about job

Returns:

job

Type
Job

(async) process(jobs)

Description:
  • Process jobs

Source:
Parameters:
Name Type Description
jobs array

= array with jobs

run(job) → {Promise}

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

Source:
Parameters:
Name Type Description
job Job

job to run

Returns:

promise

Type
Promise

runIPC(job) → {Promise}

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

Source:
Parameters:
Name Type Description
job IPCJob

job to run

Returns:

promise

Type
Promise

runLocally(job) → {Promise}

Description:
  • Run instantiated Job locally. Returns a promise.

Source:
Parameters:
Name Type Description
job Job

job to run

Returns:

promise

Type
Promise

schedule(job) → {Promise}

Description:
  • Schedule job

Source:
Parameters:
Name Type Description
job Job

job to schedule

Returns:

promise

Type
Promise

start(job) → {Promise}

Description:
  • Run job

Source:
Parameters:
Name Type Description
job Job

job to run

Returns:

promise

Type
Promise