Class: Manager

Manager

Used to manage scheduler groups, generally you only need one per project. Will deliver messages to workers through the group name and event type.

new Manager(options, basepath)

manager.js, line 80

Create an instance

Name Type Description
options object

The options passed in to the manager

Name Type Description
handlers array

Array of schedulers to Create

Name Type Description
type string

What type of launcher to use, defaults to 'ipc'

name string

What name will be used to access the scheduler workers

scheduler Scheduler

Name, Class, or Instance of scheduler to be used

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
what string

Full name (schedulerName::eventName) of event to send

data any

What data to send with the eventName

callback callback

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
options object

The options to determine what scheduler to use, what launcher, etc

Name Type Description
type string

What type of launcher to use, defaults to 'ipc'

name string

What name will be used to access the scheduler workers

scheduler Scheduler

Name, Class, or Instance of scheduler to be used

callback callback

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
what string

Name of scheduler to scale down

by number 1

How many workers to scale down, default 1

callback callback

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
what string

Name of scheduler to scale down

by number 1

How many workers to scale up, default 1

callback callback

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
what string

Name of scheduler to work with

Returns:
Type Description
Scheduler Scheduler to work with