Skip to content

Commit 2218e86

Browse files
committed
Break loop after result retreival
1 parent 10cf42f commit 2218e86

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tractor/_streaming.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,9 @@ async def aclose(self):
272272
@asynccontextmanager
273273
async def subscribe(
274274
self,
275-
276275
) -> AsyncIterator[BroadcastReceiver]:
277-
'''Allocate and return a ``BroadcastReceiver`` which delegates
276+
'''
277+
Allocate and return a ``BroadcastReceiver`` which delegates
278278
to this message stream.
279279
280280
This allows multiple local tasks to receive each their own copy
@@ -674,6 +674,7 @@ def consume(
674674
result = consume(msg)
675675
if result:
676676
self._result = result
677+
break
677678

678679
if not self._result:
679680
while True:

0 commit comments

Comments
 (0)