Make `rpc_modules` a positional arg to `tractor.run_daemon()`
parent
037c4c3797
commit
827a6c6014
|
@ -24,7 +24,7 @@ def sig_prog(proc, sig):
|
||||||
def daemon(loglevel, testdir, arb_addr):
|
def daemon(loglevel, testdir, arb_addr):
|
||||||
cmdargs = [
|
cmdargs = [
|
||||||
sys.executable, '-c',
|
sys.executable, '-c',
|
||||||
"import tractor; tractor.run_daemon(arbiter_addr={}, loglevel={})"
|
"import tractor; tractor.run_daemon((), arbiter_addr={}, loglevel={})"
|
||||||
.format(
|
.format(
|
||||||
arb_addr,
|
arb_addr,
|
||||||
"'{}'".format(loglevel) if loglevel else None)
|
"'{}'".format(loglevel) if loglevel else None)
|
||||||
|
|
|
@ -97,12 +97,14 @@ def run(
|
||||||
|
|
||||||
|
|
||||||
def run_daemon(
|
def run_daemon(
|
||||||
rpc_modules: Optional[Tuple[str]] = None,
|
rpc_modules: Tuple[str],
|
||||||
**kwargs
|
**kwargs
|
||||||
) -> None:
|
) -> None:
|
||||||
for path in rpc_modules or ():
|
"""Spawn a single daemon-actor which will repond to RPC.
|
||||||
importlib.import_module(path)
|
"""
|
||||||
|
|
||||||
kwargs['rpc_module_paths'] = rpc_modules
|
kwargs['rpc_module_paths'] = rpc_modules
|
||||||
|
|
||||||
|
for path in rpc_modules:
|
||||||
|
importlib.import_module(path)
|
||||||
|
|
||||||
return run(partial(trio.sleep, float('inf')), **kwargs)
|
return run(partial(trio.sleep, float('inf')), **kwargs)
|
||||||
|
|
Loading…
Reference in New Issue