forked from goodboy/tractor
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):
|
||||
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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue