Hello,
I am new to node.js and try to do the following:
read items from file (database entries)
for each item do expensive I/O operation (download stuff)
with the results do another expensive I/O operation (send mail)
my approach in node.js involves map from async and looks like this:
var async = require("async");
database.read(arg, function (error, results) {
async.map(results, downloadFunction, function(err, results) {
async.map(results, sendFunction, function() {
});
});
});
This does not work as expected. Particularly async.map does not work
as expected, e.g.
function small(char, callback) {
callback("error occured", char.toLowerCase());
};
async.map(["a", "b"], small, function(err, result){
console.log(err);
console.log(result);
});
results in:
error occured
[ 'a' ]
which I do not understand. As said, I am completly new to node.
Thank you.
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en