diff --git a/faust/streams.py b/faust/streams.py index 7237be684..7b12f42b5 100644 --- a/faust/streams.py +++ b/faust/streams.py @@ -843,7 +843,7 @@ async def _py_aiter(self) -> AsyncIterator: # wait for next message value: Any = None # we iterate until on_merge gives value. - while value is None: + while value is None and event is None: await sleep(0, loop=loop) # get message from channel # This inlines ThrowableQueue.get for performance: