Break loop after result retreival
parent
3f09843951
commit
daf4b4ee85
|
@ -274,9 +274,9 @@ class ReceiveMsgStream(trio.abc.ReceiveChannel):
|
||||||
@asynccontextmanager
|
@asynccontextmanager
|
||||||
async def subscribe(
|
async def subscribe(
|
||||||
self,
|
self,
|
||||||
|
|
||||||
) -> AsyncIterator[BroadcastReceiver]:
|
) -> AsyncIterator[BroadcastReceiver]:
|
||||||
'''Allocate and return a ``BroadcastReceiver`` which delegates
|
'''
|
||||||
|
Allocate and return a ``BroadcastReceiver`` which delegates
|
||||||
to this message stream.
|
to this message stream.
|
||||||
|
|
||||||
This allows multiple local tasks to receive each their own copy
|
This allows multiple local tasks to receive each their own copy
|
||||||
|
@ -692,6 +692,7 @@ class Context:
|
||||||
result = consume(msg)
|
result = consume(msg)
|
||||||
if result:
|
if result:
|
||||||
self._result = result
|
self._result = result
|
||||||
|
break
|
||||||
|
|
||||||
if not self._result:
|
if not self._result:
|
||||||
while True:
|
while True:
|
||||||
|
|
Loading…
Reference in New Issue