stathat/stathatgo — pull request #1 by LuitvD (2011-12-20 13:38:41+00:00)
Title: Added WaitForClose(timeout int64)

Function to close the internal channel for sending stats, and wait for the processStats() function to signal depletion of the channel. Useful for e.g. command-line apps with short run time.

There was no way to wait for the stats buffer (channel) to be depleted (sent to StatHat). This is one way to do it.