title: Don't understand the callback and non-blocking example - Node.js
body: <p>In the book Hands-on node, the author gives an example of blocking I\O,</p>
  
  <pre><code>var post = db.query("select * from posts where id = 1");
  doSomethingWithPost(post)
  doSomethingElse();
  </code></pre>
  
  <p>The author says nothing is executed till line 1 is finished executing db query</p>
  
  <p>And, then he shows non-blocking code</p>
  
  <pre><code>callback = function(post){
  doSomethingWithPost(post)
  }
  
  db.query("select * from posts where id = 1",callback);
  doSomethingElse();
  </code></pre>
  
  <p>Isn't this also blocking till the query is executed?</p>
  
  <p>So, doSomethingElse won't be executed till query is completed.</p>