bminer/node-mysql-queues — Issue #3: Limitation: Asynchronous calls in a query callback
Author: bminer
Created: 2011-12-29 16:27:22+00:00
State: open

For example, you can't do something like this...

```javascript
//You may be tempted to do this...
var fs = require('fs');
var trans = db.startTransaction();
trans.query("INSERT ...", [...], function(err, info) {
fs.readFile("foobar.txt", function(err, data) {
//By now, it's too late to use `trans`
if(data == "something")
trans.commit();
else
trans.rollback();
});
//The query callback is now done!! This is your last chance
//to call `commit` or `rollback`
}).execute();
```

Maybe implement Queue.pause() and Queue.resume() functions?