generator demo
implement async with generator