From 716a44b6b80f3a38cb8dde0cde4fa1a3f6841bd9 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 14 Sep 2018 16:33:45 -0400 Subject: [PATCH] Better document `run_daemon()` --- tractor/__init__.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tractor/__init__.py b/tractor/__init__.py index f6100f7..61b979c 100644 --- a/tractor/__init__.py +++ b/tractor/__init__.py @@ -97,14 +97,18 @@ def run( def run_daemon( - rpc_modules: Tuple[str], + rpc_module_paths: Tuple[str], **kwargs ) -> None: - """Spawn a single daemon-actor which will repond to RPC. - """ - kwargs['rpc_module_paths'] = rpc_modules + """Spawn daemon actor which will respond to RPC. - for path in rpc_modules: + This is a convenience wrapper around + ``tractor.run(trio.sleep(float('inf')))`` such that the first actor spawned + is meant to run forever handling to RPC requests. + """ + kwargs['rpc_module_paths'] = rpc_module_paths + + for path in rpc_module_paths: importlib.import_module(path) return run(partial(trio.sleep, float('inf')), **kwargs)