« first day (1474 days earlier)      last day (3699 days later) » 

23:02
I'll take that as a fuck off
!!afk bedtime
m59
m59
@Mosho HeBro!
@m59 Mosho is afk: bedtime
m59
m59
:'(
I have a function that will run n async calls. I pass in a callback for when they are all complete. What's the nicest way to format the results?
What is @rlemon's 12 days?
m59
m59
done(err.length ? err : null, {
  results: results, // array
  errors: errors // array
})
var results = []
 results.push({result: result, err: err});
either of those or something else?
23:11
Can it error and return results in the same call?
@m59 - { result: results } is what I do, errors or other inclusions are up to you
m59
m59
ah screws, I dunno, I'm in too much of a hurry.
@m59 - I am assuming these are db calls?
m59
m59
yep.
Sorry, I didn't think out my question there.
Next assumption, you return a subset?
m59
m59
23:13
What does that mean? My intention was just to return all of it. Actually, all I would really care about is that nothing failed, but that doesn't mean there's no reason to worry with the result objects.
Well, let's just go out on a limb and call this result a search result. If you search for city on google, it gives you millions of results. You want to return a subset of them, and not all millions.
m59
m59
I'll have to put my thought into this. I just realized there's probably no valid use for the function I'm writing
ah
Why is that?
m59
m59
The validity would probably be if I needed them run in series
I use async db calls for a search functionality.
m59
m59
23:16
that needs more than one query in parallel?
Well, I have a 4nf relational db with 25 tables
m59
m59
hm, I guess I can add the fn's just to be complete
So I query the tables in parallel and return arrays of primary keys
and then just query for the intersecting set
m59
m59
I need one to run queries in parallel and another in sequence.
is it ok to pass an array of errors to done as the first argument?
done(errs.length ? errs : null, results)
Why would there be more than 1 error?
m59
m59
23:34
All running in parallel
in sequence, I'd just break out of it of course.
Has anyone here ever used rosetta stone for anything? They're having a sale and I kinda want to grab the japanese version
m59
m59
If there are errors, doesn't that mean that whole part of the app should shut off anyway? I guess that's what you mean?
I love the age we live in
just ordered an adapter for my cd32 to use standard keyboards and mice
@m59 - Well, I meant that if there were an error, it would probably halt the whole process and you would get the error back as the "what happened" part.
@Cereal - Never used it, heard good things though
@Cereal - Pimsleur is another options

« first day (1474 days earlier)      last day (3699 days later) »