def __call__(self, *args, **kwargs): args = list(args) rpc_id = args[0] del args[0] args = tuple(args) self.host = get_host() param = (self.__method, rpc_id, args, kwargs) # t = Thread(target=self.invoke, args=param) # t.start() self.host.new_parallel(self.invoke, param)
def __call__(self, *args, **kwargs): args = list(args) rpc_id = args[0] del args[0] args = tuple(args) self.host = get_host() param = (self.__method, rpc_id, args, kwargs) # t = spawn(self.invoke, *param) # New thread # get_host().new_parallel(self.__actor.url, t) self.host.new_parallel(self.invoke, param)
def result(self, timeout=None): """Returns the result of the call that the future represents. :param timeout: The number of seconds to wait for the result if the future has not been completed. None, the default, sets no limit. :returns: The result of the call that the future represents. :raises: TimeoutError: If the timeout is reached before the future ends execution. :raises: Exception: If the call raises the Exception. """ result = super(FutureRef, self).result(timeout) return get_host().loads(result)
def __call__(self, *args, **kwargs): self.host = get_host() param = (self.__method, args, kwargs) # t = spawn(self.invoke, *param) # get_host().new_parallel(self.__actor.url, t) self.host.new_parallel(self.invoke, param)
def __call__(self, *args, **kwargs): param = (self.__method, args, kwargs) self.host = get_host() # t = Thread(target=self.invoke, args=param) # t.start() self.host.new_parallel(self.invoke, param)