perfecting async sample handling from mozilla ammeter