From b58384fb2ce97fa30eea793f1be90c056d362794 Mon Sep 17 00:00:00 2001 From: Brian C Date: Fri, 2 Jun 2017 17:27:39 -0500 Subject: [PATCH] Destroyed Queryqueue (markdown) --- Queryqueue.md | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 Queryqueue.md diff --git a/Queryqueue.md b/Queryqueue.md deleted file mode 100644 index 91b2dc8..0000000 --- a/Queryqueue.md +++ /dev/null @@ -1,26 +0,0 @@ -An advanced usage feature which might come in handy is using the internal query queue to queue up several queries in a row. __[[Clients|Client]]__ are responsible for creating __[[Queries|Query]]__ via the factory method Client#query. The __Client__ can create a new query before the client is connected to the server or while other queries are executing. Internally the __Client__ maintains a queue of __Query__ objects which are popped and executed as the preceding __Query__ completes. The error handling semantics here get really complicated and isn't recommended unless you're banging out a quick script and don't care about error handling or you really, really have some specific use case. This "feature" is mostly a hold-over from a bad design decision I made years ago, but have left to maintain backwards compatibility. - -#### example -```javascript - var client = new Client(...); - var query1 = client.query("SELECT * FROM NOW()"); //query is queued. client is not connected - query1.on('end', function() { - console.log('query 1 completed'); - }); - var query2 = client.query("SELECT * FROM NOW()"); //also queued - query2.on('end', function() { - console.log('query 2 completed'); - }); - client.on('drain', function() { - console.log("drained"); - }); - //at this point nothing has been printed to the console - client.connect(); - //this will print the following: - //query 1 completed - //query 2 completed - //drained -``` - -*** -[[◄ Back (Example App)|Example]] ` ` [[Next (Testing) ►|Testing]] \ No newline at end of file