Batch class
Batch provides basic parallel execution with concurrency limits. Will stop execute left operations when one of the executed operation throws an error. But Batch cannot cancel ongoing operations, you need to cancel them by yourself.
Constructors
| Batch(undefined | number) | Creates an instance of Batch. |
Methods
| add |
Add a operation into queue. |
| do() | Start execute operations in the queue. |
Constructor Details
Batch(undefined | number)
Creates an instance of Batch.
new Batch(concurrency?: undefined | number)
Parameters
- concurrency
-
undefined | number
Method Details
addOperation(Operation)
Add a operation into queue.
function addOperation(operation: Operation)
Parameters
- operation
- Operation
do()
Start execute operations in the queue.
function do()
Returns
Promise<void>