Created
September 6, 2011 09:51
-
-
Save sergi/1197149 to your computer and use it in GitHub Desktop.
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 pasv, pasvReqs; | |
pasvReqs = function(next, stop) { | |
pasv = next; | |
}; | |
pasvReqs(self.processPasv, function(err) { console.log(err) }); | |
var processPasv = function(pasvData) { | |
console.log("PASVDATA", pasvData); | |
}; | |
// ----- | |
var enqueue = function(m, c) { | |
pasv({ | |
mode: m, | |
callback: c | |
}); | |
} |
Gozala
commented
Sep 6, 2011
var pasvReqs = queue(....)
!function recur() {
// Take first element from `pasvReqs` and process it via `processElement` black box that will call
// `recur` once it's done to process next element from the `pasvReqs` queue.
head(pasvReqs)(function(element) {
processElement(element, recur)
})
}()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment