title: write async function with EventEmitter
body: <p>I am new in node and try to use async and event behavior advantages in node. I used to understand from node, everything that handle with Event object, it gonna be async execution.<br>
  Then i had try this, consider following code:  </p>
  
  <pre><code>var events = require("events");
  
  var event = new events.EventEmitter();
  
  
  event.on("work", function () {
  
      for (var i = 0; i &lt;= 10; i++) {
          console.log("I do my work " + i);
      }
  
      event.emit("done");
  });
  
  var async = function (cb) {
  
      event.on("done", cb);
      event.emit("work");
      for (var i = 0; i &lt;= 10; i++) {
          console.log("Async " + i);
      }
  }
  
  
  async(function () {
      console.log("I am done callback!");
  });  
  </code></pre>
  
  <p>This is async execution? In my opinion no! Why, because i had read this sentence many:  </p>
  
  <blockquote>
    <p>An event is fired, so go and do something and then when you have finished it, come
    back and tell me, but in meanwhile i will do something else.  </p>
  </blockquote>
  
  <p>Like a fast food restaurant scenario. But the code above, when the event work gonna fired, following sequence will happen:  </p>
  
  <ol>
  <li>go into the callback</li>
  <li>let through the loop</li>
  <li>output I do my work n</li>
  <li>fired the done event</li>
  <li>output I am done callback!</li>
  <li>output Async n</li>
  </ol>
  
  <p>why I am done callback! gonna output before Async n? Why is here not like fast food restaurant scenario, like</p>
  
  <blockquote>
    <p>the work event is fired, go and do you stuff and come back when you
    done, in meanwhile i will output Async n  </p>
  </blockquote>
  
  <p>This is i used to understand about event driven behavior and async in node. But now i am very confused. I know, javascript works on single thread. How can i write an async function with event emitter? But i think is not possible, because when i emit an event, it will immediately execute the handler. </p>