From 203f95615cc9a16cb6280418e2f339b9a36dae07 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 30 Jan 2023 12:42:26 -0500 Subject: [PATCH] Add nooz --- nooz/343.trivial.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 nooz/343.trivial.rst diff --git a/nooz/343.trivial.rst b/nooz/343.trivial.rst new file mode 100644 index 0000000..1193f3c --- /dev/null +++ b/nooz/343.trivial.rst @@ -0,0 +1,19 @@ +Rework our ``.trionics.BroadcastReceiver`` internals to avoid method +recursion and approach a design and interface closer to ``trio``'s +``MemoryReceiveChannel``. + +The details of the internal changes include: + +- implementing a ``BroadcastReceiver.receive_nowait()`` and using it + within the async ``.receive()`` thus avoiding recursion from + ``.receive()``. +- failing over to an internal ``._receive_from_underlying()`` when the + ``_nowait()`` call raises ``trio.WouldBlock`` +- adding ``BroadcastState.statistics()`` for debugging and testing both + internals and by users. +- add an internal ``BroadcastReceiver._raise_on_lag: bool`` which can be + set to avoid ``Lagged`` raising for possible use cases where a user + wants to choose between a [cheap or nasty + pattern](https://zguide.zeromq.org/docs/chapter7/#The-Cheap-or-Nasty-Pattern) + the the particular stream (we use this in ``piker``'s dark clearing + engine to avoid fast feeds breaking during HFT periods).