class AsyncLoop
An implementation of a loop for asynchronous functions.
Constroctor.
Name | Type | Description | |||
---|---|---|---|---|---|
iterations | number | the number of iterations. | |||
_fn | asyncLoop | AsyncLoop |
| the function to run each iteration | _successCallback | | the callback that will be called upon succesful execution
Execute the next iteration. Must be called after the last iteration was finished.
Break the loop and run the success callback.
Helper function
Name | Type | Description | |||
---|---|---|---|---|---|
iterations | number | ||||
_fn | asyncLoop | AsyncLoop |
| | _successCallback | |
A for-loop that will run a given number of iterations synchronous and the rest async.
@constructor
Name | Type | Description | |||
---|---|---|---|---|---|
iterations | number | total number of iterations | |||
syncedIterations | number | number of synchronous iterations in each async iteration. | |||
fn | iteration | number |
| the function to call each iteration. | callback | | a success call back that will be called when iterating stops. optional | breakFunction | | a break condition (optional)