Class WorkerPool
Coordinates a group of WebWorkers.
Defined in: benchgl.js.
Constructor Attributes | Constructor Name and Description |
---|---|
WorkerPool(filename, n)
Creates a new WorkerPool.
|
Method Attributes | Method Name and Description |
---|---|
clean()
Cleans the configurations previously assigned to workers in this WorkerGroup.
|
|
map(mapper)
Maps configurations to the workers in this WorkerPool.
|
|
reduce(reducer, callback, base)
Starts and merges the computation of the workers in this WorkerGroup.
|
|
shutDown()
Shuts down all the workers in this WorkerGroup.
|
Class Detail
WorkerPool(filename, n)
Creates a new WorkerPool.
- Parameters:
- {String} filename
- The filename for the worker script.
- {Number} n
- The number of WebWorkers to create.
Method Detail
clean()
Cleans the configurations previously assigned to workers in this WorkerGroup.
map(mapper)
Maps configurations to the workers in this WorkerPool.
- Parameters:
- {Function} mapper
- The mapping function.
reduce(reducer, callback, base)
Starts and merges the computation of the workers in this WorkerGroup.
- Parameters:
- {Function} reducer
- The function to merge the results.
- {Function} callback
- A callback function to call when te work is done.
- {Object} base
- A base result to start the computation from.
shutDown()
Shuts down all the workers in this WorkerGroup.