From 6ff3b6c757465ea26bb6a8a0dd579744582927d3 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 10 Apr 2025 23:55:41 -0400 Subject: [PATCH] Use `current_ipc_protos()` as the `enable_transports`-default-when-`None` Also ensure we assertion-error whenever the list is > 1 entry for now! --- tractor/_root.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tractor/_root.py b/tractor/_root.py index f67d746a..1bcfa00b 100644 --- a/tractor/_root.py +++ b/tractor/_root.py @@ -149,8 +149,10 @@ async def open_root_actor( arbiter_addr: tuple[UnwrappedAddress]|None = None, enable_transports: list[ + # TODO, this should eventually be the pairs as + # defined by (codec, proto) as on `MsgTransport. _state.TransportProtocolKey, - ] = [_state._def_tpt_proto], + ]|None = None, name: str|None = 'root', @@ -213,6 +215,14 @@ async def open_root_actor( debug_mode=debug_mode, maybe_enable_greenback=maybe_enable_greenback, ): + if enable_transports is None: + enable_transports: list[str] = _state.current_ipc_protos() + + # TODO! support multi-tpts per actor! Bo + assert ( + len(enable_transports) == 1 + ), 'No multi-tpt support yet!' + _debug.hide_runtime_frames() __tracebackhide__: bool = hide_tb