DistributeJs
Distribute anonymous function executions over a defined timespan
Install
$ npm i -S distribute-js
Usage
const Distribution = ;const collection = ; collection; collection; const promise = distribution;promise;
API
Methods
add(callable)
Method to add a new function to the stack.
Arguments
Argument | Type | Description |
---|---|---|
callable | Function |
Function to be added to the execution stack. |
in(timespan)
Method to set the timespan in which all functions should be executed.
Arguments
Argument | Type | Description |
---|---|---|
timespan | Number |
Timespan in milliseconds. |
run()
Method to execute the call stack. Returns a Promise.
License
GPL-2.0 © Willi Eßer