http://thisthread.blogspot.com/2013/08/waiting-asynchronously.html