-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscratch.js
32 lines (32 loc) · 844 Bytes
/
scratch.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var async=require("async")
mock=function(callback) {
setTimeout(function() {
results='hello'
console.log("why are you doing this to me")
callback(null,results)
},3000)
}
processOutLinks=function(callback) {
console.log('hello')
results=[]
mock(callback)
}
processInLinks=function(callback) {
console.log('there')
callback(null,2)
}
sendResults=function(res) {
console.log("Finally",res)
}
async.parallel([
function(callback) {
processOutLinks(callback)
},
function(callback) {
processInLinks(callback)
}
],
function(err,results) { //finished parallel
console.log("Results--->",JSON.stringify(results))
sendResults(results)
})