title: Wait until node-amqp has sent a message?
body: <p>If I use the following code to send a message to RabbitMQ:</p>
  
  <pre><code>var amqp = require('amqp');
  var connection = amqp.createConnection();
  connection.on('ready', function() {
    connection.publish('foo', 'Hello');
    process.exit();
  });
  </code></pre>
  
  <p>...then the message is never sent, and the process just quits. If I remove <code>process.exit()</code>, then the message is sent, but the process never quits.</p>
  
  <p>How do I get <strong>node-amqp</strong> to tell me when it has sent a message?</p>