title: socket.io + using 'emit' with a callback?
body: <p>I'm having an issue with my sockets where my server side code is executing before my <code>socket.emit</code> finishes. Here's a snippet:</p>
  
  <pre><code>admin.getTh(function(th){
     socket.emit('GPS', {gpsResults: data, thresholds: th, PEMSID: PEMSID, count: count});
     count++;
     toolbox.drawPaths(function(ta){
          console.log(ta);
     });
  });
  </code></pre>
  
  <p>So what I need to have happen is the code that gets executed on the client via <code>socket.emit('GPS', ...)</code> to completely finish before <code>toolbox.drawPaths</code> happens. I tried to toss a callback on the <code>emit</code> like you would <code>socket.on(..., function(){...})</code> but that doesn't seem to be part of the API. Any suggestions?</p>