Skip to content

Instantly share code, notes, and snippets.

@thejh
Created October 8, 2011 21:20
Show Gist options
  • Save thejh/1272898 to your computer and use it in GitHub Desktop.
Save thejh/1272898 to your computer and use it in GitHub Desktop.
var q1 = client.query("QUERY1");
var counter = 1;
q1.on('row', function(r1) {
var q2 = client.query("QUERY2 WHERE `id`='"+r1.id+"'");
counter++;
q2.on('row', function(r2)) {
HTTPres.write(r2.value);
}
q2.on('end', funciton() {
if (!--counter) HTTPres.end();
});
});
q1.on('end', function() {
if (!--counter) HTTPres.end();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment