(self, name)
Get a field or callable from the actor.
Get a field or callable from the actor.
Get a field or callable from the actor .
def __getattr__(self, name):
        """Get a field or callable from the actor."""
        attr_path = self._attr_path + (name,)

        if attr_path not in self._known_attrs:
            self._known_attrs = self._introspect_attributes()

        attr_info = self._known_attrs.get(attr_path)
        if attr_info is None:
            raise AttributeError(f"{self} has no attribute {name!r}")

        if attr_info.callable:
            if attr_path not in self._callable_proxies:
                self._callable_proxies[attr_path] = CallableProxy(
                    self.actor_ref, attr_path
                )
            return self._callable_proxies[attr_path]
        elif attr_info.traversable:
            if attr_path not in self._actor_proxies:
                self._actor_proxies[attr_path] = ActorProxy(self.actor_ref, attr_path)
            return self._actor_proxies[attr_path]
        else:
            message = messages.ProxyGetAttr(attr_path=attr_path)
            return self.actor_ref.ask(message, block=False)
def __getattr__ ( self , name ) : attr_path = self . _attr_path + ( name , ) if attr_path not in self . _known_attrs : self . _known_attrs = self . _introspect_attributes ( ) attr_info = self . _known_attrs . get ( attr_path ) if attr_info is None : raise AttributeError ( f"{self} has no attribute {name!r}" ) if attr_info . callable : if attr_path not in self . _callable_proxies : self . _callable_proxies [ attr_path ] = CallableProxy ( self . actor_ref , attr_path ) return self . _callable_proxies [ attr_path ] elif attr_info . traversable : if attr_path not in self . _actor_proxies : self . _actor_proxies [ attr_path ] = ActorProxy ( self . actor_ref , attr_path ) return self . _actor_proxies [ attr_path ] else : message = messages . ProxyGetAttr ( attr_path = attr_path ) return self . actor_ref . ask ( message , block = False )