From ea9b66d1c3f02cbcdcfffb3e2eefb8385418a8dd Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 5 Nov 2021 09:33:48 -0400 Subject: [PATCH] Hotfix: open a tractor context to fsps... The prior PR for fixing fsp array misalignment also added `tractor.Context` usage which wasn't reflected in the graphics update loop (newer code added it but the prior PR was factored from path dependent history) and thus was broken. Further in newer work we don't have fsp actors actually stream value updates since the display loop can already pull from the source feed and update graphics at a preferred throttle rate. Re-enabled the fsp stream sending here by default until that newer only-throttle-pull-from-source code is landed in the display loop. --- piker/fsp/_engine.py | 2 +- piker/ui/_display.py | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/piker/fsp/_engine.py b/piker/fsp/_engine.py index 883f5853..c6e9299d 100644 --- a/piker/fsp/_engine.py +++ b/piker/fsp/_engine.py @@ -90,7 +90,7 @@ async def fsp_compute( func_name: str, func: Callable, - attach_stream: bool = False, + attach_stream: bool = True, task_status: TaskStatus[None] = trio.TASK_STATUS_IGNORED, ) -> None: diff --git a/piker/ui/_display.py b/piker/ui/_display.py index ab85e761..7859d23b 100644 --- a/piker/ui/_display.py +++ b/piker/ui/_display.py @@ -427,7 +427,7 @@ async def run_fsp( ) async with ( - portal.open_stream_from( + portal.open_context( # chaining entrypoint fsp.cascade, @@ -437,21 +437,17 @@ async def run_fsp( src_shm_token=src_shm.token, dst_shm_token=conf['shm'].token, symbol=sym, - fsp_func_name=fsp_func_name, + func_name=fsp_func_name, loglevel=loglevel, - ) as stream, - + ) as (ctx, last_index), + ctx.open_stream() as stream, open_sidepane( linkedsplits, display_name, ) as sidepane, ): - # receive last index for processed historical - # data-array as first msg - _ = await stream.receive() - shm = conf['shm'] if conf.get('overlay'):