This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Promise.eval = function(ar) | |
{ | |
// We accept either an array or items specified as individual arguments... | |
// ...but we convert the series into an array either way | |
if(!Array.isArray(ar)) | |
ar = Array.prototype.slice.call(arguments) | |
var items = { } // map names to items | |
// This forEach is where it all happens - we evaluate each item within the eval array. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var batchSize = 1000, | |
doBluebirdAll = true, | |
doZousanAll = true, | |
doNativeAll = true, | |
doBluebirdSeries = true, | |
doZousanSeries = true, | |
doNativeSeries = true | |
console.log(" - Batch Size: " + batchSize) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This function uses the Page Visibility API to puase/restart the timeout such that | |
* the time you specify equates to "visibility time". | |
* Note: There is no clearTimeout capability - though it would not be hard to extend this to | |
* provide cancel-ability | |
* | |
* Usage: | |
* setVisiTimeout(function, ms, arg1, arg2, ... ); | |
* | |
* LICENSE: Unlicense <http://unlicense.org/> / CC0 |
NewerOlder