From 3c5816c97791ee729f8d53157afc373a48f9487a Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 2 Jul 2024 15:53:33 -0400 Subject: [PATCH] Add `Portal.chan` property, to wrap `._chan` attr --- tractor/_portal.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tractor/_portal.py b/tractor/_portal.py index 0f69883..3dc7f3a 100644 --- a/tractor/_portal.py +++ b/tractor/_portal.py @@ -97,7 +97,7 @@ class Portal: channel: Channel, ) -> None: - self.chan = channel + self._chan: Channel = channel # during the portal's lifetime self._final_result_pld: Any|None = None self._final_result_msg: PayloadMsg|None = None @@ -109,6 +109,10 @@ class Portal: self._streams: set[MsgStream] = set() self.actor: Actor = current_actor() + @property + def chan(self) -> Channel: + return self._chan + @property def channel(self) -> Channel: '''