Wake up consumers on end of channel as well
parent
cfdc95fe7f
commit
61e134dc5d
|
@ -222,7 +222,10 @@ class BroadcastReceiver(ReceiveChannel):
|
||||||
event.set()
|
event.set()
|
||||||
return value
|
return value
|
||||||
|
|
||||||
except trio.Cancelled:
|
except (
|
||||||
|
trio.Cancelled,
|
||||||
|
trio.EndOfChannel,
|
||||||
|
):
|
||||||
# handle cancelled specially otherwise sibling
|
# handle cancelled specially otherwise sibling
|
||||||
# consumers will be awoken with a sequence of -1
|
# consumers will be awoken with a sequence of -1
|
||||||
# state.recv_ready = trio.Cancelled
|
# state.recv_ready = trio.Cancelled
|
||||||
|
@ -274,11 +277,12 @@ class BroadcastReceiver(ReceiveChannel):
|
||||||
async def subscribe(
|
async def subscribe(
|
||||||
self,
|
self,
|
||||||
) -> AsyncIterator[BroadcastReceiver]:
|
) -> AsyncIterator[BroadcastReceiver]:
|
||||||
'''Subscribe for values from this broadcast receiver.
|
'''
|
||||||
|
Subscribe for values from this broadcast receiver.
|
||||||
|
|
||||||
Returns a new ``BroadCastReceiver`` which is registered for and
|
Returns a new ``BroadCastReceiver`` which is registered for and
|
||||||
pulls data from a clone of the original ``trio.abc.ReceiveChannel``
|
pulls data from a clone of the original
|
||||||
provided at creation.
|
``trio.abc.ReceiveChannel`` provided at creation.
|
||||||
|
|
||||||
'''
|
'''
|
||||||
if self._closed:
|
if self._closed:
|
||||||
|
|
Loading…
Reference in New Issue