Generator based timeout