new WorkPool(opts)
Parameters:
Name | Type | Description |
---|---|---|
opts |
Object | Options. |
- Source:
- mapspace/collections/workpool.js
Methods
-
length()
-
Returns total number of tasks in pool.
- Source:
- mapspace/collections/workpool.js
Returns:
The number of tasks.
- Type
- number
-
pause()
-
Pauses all queues.
- Source:
- mapspace/collections/workpool.js
-
push(fn, cb)
-
Adds a task to the pool.
Parameters:
Name Type Description fn
function function to execute.
cb
function callback.
- Source:
- mapspace/collections/workpool.js
Returns:
The cancellation function.
- Type
- function
-
resume()
-
Restarts all queues.
- Source:
- mapspace/collections/workpool.js