Remove use of `tractor.run()`

chart_trader
Tyler Goodlet 2020-12-28 13:07:17 -05:00
parent d7f80d8ddb
commit 5d30f351af
2 changed files with 13 additions and 15 deletions

View File

@ -159,20 +159,20 @@ def run_qtractor(
'main': instance,
}
# setup tractor entry point args
main = partial(
tractor._main,
async_fn=func,
args=args + (widgets,),
arbiter_addr=(
tractor._default_arbiter_host,
tractor._default_arbiter_port,
),
name='qtractor',
**tractor_kwargs,
)
# define tractor entrypoint
async def main():
# guest mode
async with tractor.open_root_actor(
arbiter_addr=(
tractor._root._default_arbiter_host,
tractor._root._default_arbiter_port,
),
name='qtractor',
**tractor_kwargs,
) as a:
await func(*(args + (widgets,)))
# guest mode entry
trio.lowlevel.start_guest_run(
main,
run_sync_soon_threadsafe=run_sync_soon_threadsafe,

View File

@ -112,8 +112,6 @@ CHART_MARGINS = (0, 0, 2, 2)
_min_points_to_show = 6
_bars_from_right_in_follow_mode = int(6**2)
_bars_to_left_in_follow_mode = int(6**3)
_tina_mode = False