Simulate how llm serving engines like vllm make use of python asyncio.Queue to achieve dynamic batching: batch generation at the iteration level.