How does futures handle a callback that has more than one argument? This is critical to just about every use I could have for futures. The github example shows it only handleing one argument.
The example from the Github Readme is
var fileNames = readdir('.').wait();
But what about something a mysql call like
client.query("select * from employees", function(err, results, fields) {
// callback function returns employees array
callback(results);
});
How would I get those three (err
, results
, and fields
) using the futures wait()
method?
Edit
Experimentation has taught me that the first argument of the callback, in this case err
, is always treated as an error and is thrown if the value is truthy. The second argument is assigned. Any further arguments are ignored as best as I can tell.