msiebuhr/node-statsd-client — pull request #18 by jergason (2012-10-19 17:02:59+00:00)
Title: Make socket creation asynchronous

Fixes issue [#4](https://github.com/msiebuhr/node-statsd-client/issues/4), where a socket is created with `dgram.createSocket()`, but the socket used before it is ready.

This only happens under high load, but that is exactly when you want metrics, and don't want them to cause exceptions to be thrown. :)

To support this, I also added logic to enqueue requests to send data that happen while a socket is not yet ready.

All the tests pass still, but I wasn't sure what else to add to test this. Any suggestions are welcome.