Make `rpc_modules` a positional arg to `tractor.run_daemon()`

multi_program_tests
Tyler Goodlet 2018-09-10 21:56:40 -04:00
parent 037c4c3797
commit 827a6c6014
2 changed files with 7 additions and 5 deletions

View File

@ -24,7 +24,7 @@ def sig_prog(proc, sig):
def daemon(loglevel, testdir, arb_addr):
cmdargs = [
sys.executable, '-c',
"import tractor; tractor.run_daemon(arbiter_addr={}, loglevel={})"
"import tractor; tractor.run_daemon((), arbiter_addr={}, loglevel={})"
.format(
arb_addr,
"'{}'".format(loglevel) if loglevel else None)

View File

@ -97,12 +97,14 @@ def run(
def run_daemon(
rpc_modules: Optional[Tuple[str]] = None,
rpc_modules: Tuple[str],
**kwargs
) -> None:
for path in rpc_modules or ():
importlib.import_module(path)
"""Spawn a single daemon-actor which will repond to RPC.
"""
kwargs['rpc_module_paths'] = rpc_modules
for path in rpc_modules:
importlib.import_module(path)
return run(partial(trio.sleep, float('inf')), **kwargs)