Skip to content

Commit

Permalink
Break loop after result retreival
Browse files Browse the repository at this point in the history
  • Loading branch information
goodboy committed Apr 10, 2022
1 parent 10cf42f commit 2218e86
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tractor/_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -674,6 +674,7 @@ def consume(
result = consume(msg)
if result:
self._result = result
break

if not self._result:
while True:
Expand Down

0 comments on commit 2218e86

Please sign in to comment.