From 0b3590c3c600f26e9220729d174af4c605b6c051 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sun, 10 Apr 2022 19:18:40 -0400 Subject: [PATCH] Break loop after result retreival --- tractor/_streaming.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tractor/_streaming.py b/tractor/_streaming.py index 962946433..2835f6ce0 100644 --- a/tractor/_streaming.py +++ b/tractor/_streaming.py @@ -272,9 +272,9 @@ async def aclose(self): @asynccontextmanager async def subscribe( self, - ) -> AsyncIterator[BroadcastReceiver]: - '''Allocate and return a ``BroadcastReceiver`` which delegates + ''' + Allocate and return a ``BroadcastReceiver`` which delegates to this message stream. This allows multiple local tasks to receive each their own copy @@ -681,6 +681,7 @@ def consume( result = consume(msg) if result: self._result = result + break if not self._result: while True: