forked from goodboy/tractor
Don't overload `func` arg
parent
034146f2b1
commit
109b5971ed
|
@ -217,11 +217,11 @@ class LocalPortal:
|
||||||
) -> None:
|
) -> None:
|
||||||
self.actor = actor
|
self.actor = actor
|
||||||
|
|
||||||
async def run(self, ns: str, func: str, **kwargs) -> Any:
|
async def run(self, ns: str, func_name: str, **kwargs) -> Any:
|
||||||
"""Run a requested function locally and return it's result.
|
"""Run a requested function locally and return it's result.
|
||||||
"""
|
"""
|
||||||
obj = self.actor if ns == 'self' else importlib.import_module(ns)
|
obj = self.actor if ns == 'self' else importlib.import_module(ns)
|
||||||
func = getattr(obj, func)
|
func = getattr(obj, func_name)
|
||||||
if inspect.iscoroutinefunction(func):
|
if inspect.iscoroutinefunction(func):
|
||||||
return await func(**kwargs)
|
return await func(**kwargs)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue