var async = require('async'); var files = ['file1','file2','file3']; var urls = ['url1','url2','url3']; var down = function(url, file, callback) { setTimeout(function(){ var r = Math.random() >= 0.5; console.log('--- end '+file+', '+url+', '+r); callback(r); }, 1000); }; async.concat(files, function(file, callback){ async.someSeries(urls, function(url, callback1){ down(url, file, function(isOk){ callback1(null, isOk); }); }, function(err, r){ callback(err, r); }); }, function(err, fullRes){ console.log('done'); console.log(fullRes); });
Tags
Categories
- Android (4)
- Apache (3)
- async.js (2)
- CSS (2)
- d3.js (1)
- Eclipse (1)
- GIMP (1)
- git (5)
- github (1)
- Grafika / foto (1)
- HTML (4)
- Java (26)
- JavaScript (3)
- jetty (2)
- jQuery (2)
- Linki (8)
- Linux (148)
- Linux shell (31)
- Maven (6)
- MySQL (11)
- node.js (3)
- npm (1)
- OpenOffice (2)
- Perl (1)
- PHP (3)
- plink (1)
- PostgreSQL (7)
- Python (3)
- Retrofit (1)
- Richfaces (1)
- Różne (5)
- RxJava (3)
- Spring (7)
- Spring Boot (1)
- SQL Server (1)
- ssh (1)
- SSL (1)
- Subversion (2)
- SVN (1)
- tomcat (1)
- Uncategorized (21)
- Video (7)
- vim (4)
- VirtualBox (1)
Strony
RSS Links
Meta