From 761b82393977f03397fc9015fb3f8922456be22d Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sun, 6 Mar 2022 17:03:37 -0500 Subject: [PATCH] Always fire a "step/update message" on every fsp history update --- piker/fsp/_engine.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/piker/fsp/_engine.py b/piker/fsp/_engine.py index 7e75c283..f1904000 100644 --- a/piker/fsp/_engine.py +++ b/piker/fsp/_engine.py @@ -127,8 +127,8 @@ async def fsp_compute( # each respective field. fields = getattr(dst.array.dtype, 'fields', None).copy() fields.pop('index') - # TODO: nptyping here! - history: Optional[np.ndarray] = None + history: Optional[np.ndarray] = None # TODO: nptyping here! + if fields and len(fields) > 1 and fields: if not isinstance(history_output, dict): raise ValueError( @@ -209,6 +209,12 @@ async def fsp_compute( try: # rt stream async with ctx.open_stream() as stream: + + # always trigger UI refresh after history update, + # see ``piker.ui._fsp.FspAdmin.open_chain()`` and + # ``piker.ui._display.trigger_update()``. + await stream.send(index) + async for processed in out_stream: log.debug(f"{func_name}: {processed}")