Messing around with generators to do asynchronous tasks