new Manager(options, basepath)
Create an instance
| Name | Type | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
The options passed in to the manager
|
||||||||||||||||||
basepath |
string |
Basepath to load IPC workers from |
Methods
-
do(what, data, callback)
manager.js, line 185 -
Sends an event to a scheduler
Name Type Description whatstring Full name (schedulerName::eventName) of event to send
dataany What data to send with the eventName
callbackcallback Callback to be called when worker has completed the task
-
register(options, callback)
manager.js, line 112 -
Registers a new scheduler by name
Name Type Description optionsobject The options to determine what scheduler to use, what launcher, etc
Name Type Description typestring What type of launcher to use, defaults to 'ipc'
namestring What name will be used to access the scheduler workers
schedulerScheduler Name, Class, or Instance of scheduler to be used
callbackcallback Optional, called once scheduler is ready and workers have been scaled up
-
scaleDown(what, by, callback)
manager.js, line 146 -
Scales down (removes workers) a specific scheduler
Name Type Default Description whatstring Name of scheduler to scale down
bynumber 1 How many workers to scale down, default 1
callbackcallback Optional, called once workers have been scaled down
-
scaleUp(what, by, callback)
manager.js, line 161 -
Scales up (add workers) a specific scheduler
Name Type Default Description whatstring Name of scheduler to scale down
bynumber 1 How many workers to scale up, default 1
callbackcallback Optional, called once workers have been scaled up
-
with(what){Scheduler}
manager.js, line 176 -
Returns a scheduler to perform work with
Name Type Description whatstring Name of scheduler to work with
Returns:
Type Description Scheduler Scheduler to work with