Skip to content
This repository has been archived by the owner on Mar 14, 2019. It is now read-only.

Latest commit

 

History

History
82 lines (60 loc) · 2.41 KB

API.md

File metadata and controls

82 lines (60 loc) · 2.41 KB

Functions

registerHandler(jobType, callback, [serverIndex])

Register a job handler

Typedefs

ControlHarness : Object

Job control harness

registerHandler(jobType, callback, [serverIndex])

Register a job handler

Kind: global function

Param Type Default Description
jobType String The type of job to handle
callback function The callback method, which takes 2 parameters
[serverIndex] Number 0 The optional server index, if multiple servers are used

Example

registerHandler("jobType", (data, control) => {
     control.setProgressMax(100);
     control.setProgress(1);
     // do something with `data`
     return data.item + 1;
 });

ControlHarness : Object

Job control harness

Kind: global typedef
Properties

Name Type Description
id String The job ID
progress Number The job progress
progressMax Number The max progress
type String The job type

ControlHarness.setProgress ⇒ ControlHarness

Set the current progress of the job

Kind: static property of ControlHarness
Returns: ControlHarness - Self

Param Type Description
progress Number The new progress value

ControlHarness.setProgressMax ⇒ ControlHarness

Set the max progress for the job

Kind: static property of ControlHarness
Returns: ControlHarness - Self

Param Type Description
max Number The new max progress value