From 86377787392c1ecb06c41ba99d49677d1045baec Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 30 Jan 2023 12:18:23 -0500 Subject: [PATCH] Expose `raise_on_lag: bool` flag through factory --- tractor/trionics/_broadcast.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tractor/trionics/_broadcast.py b/tractor/trionics/_broadcast.py index 96e705a..42b1704 100644 --- a/tractor/trionics/_broadcast.py +++ b/tractor/trionics/_broadcast.py @@ -157,7 +157,7 @@ class BroadcastReceiver(ReceiveChannel): rx_chan: AsyncReceiver, state: BroadcastState, receive_afunc: Optional[Callable[[], Awaitable[Any]]] = None, - raise_on_lag: bool = False, + raise_on_lag: bool = True, ) -> None: @@ -388,6 +388,8 @@ class BroadcastReceiver(ReceiveChannel): @asynccontextmanager async def subscribe( self, + raise_on_lag: bool = True, + ) -> AsyncIterator[BroadcastReceiver]: ''' Subscribe for values from this broadcast receiver. @@ -405,6 +407,7 @@ class BroadcastReceiver(ReceiveChannel): rx_chan=self._rx, state=state, receive_afunc=self._recv, + raise_on_lag=raise_on_lag, ) # assert clone in state.subs assert br.key in state.subs @@ -442,7 +445,7 @@ def broadcast_receiver( recv_chan: AsyncReceiver, max_buffer_size: int, receive_afunc: Optional[Callable[[], Awaitable[Any]]] = None, - raise_on_lag: bool = False, + raise_on_lag: bool = True, ) -> BroadcastReceiver: