Always fire a "step/update message" on every fsp history update

m4_corrections
Tyler Goodlet 2022-03-06 17:03:37 -05:00
parent 4ac65a93ae
commit 2c9ecbae9a
1 changed files with 8 additions and 2 deletions

View File

@ -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}")