From 292513b3535fa04d72dd0dce17a26a833857f1e7 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sat, 8 Aug 2020 20:58:04 -0400 Subject: [PATCH] Module define default accept addr --- tractor/_trionics.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tractor/_trionics.py b/tractor/_trionics.py index 746960c..e846144 100644 --- a/tractor/_trionics.py +++ b/tractor/_trionics.py @@ -18,6 +18,8 @@ from . import _spawn log = get_logger('tractor') +_default_bind_addr: Tuple[str, int] = ('127.0.0.1', 0) + class ActorNursery: """Spawn scoped subprocess actors. @@ -48,7 +50,7 @@ class ActorNursery: self, name: str, *, - bind_addr: Tuple[str, int] = ('127.0.0.1', 0), + bind_addr: Tuple[str, int] = _default_bind_addr, statespace: Optional[Dict[str, Any]] = None, rpc_module_paths: List[str] = None, loglevel: str = None, # set log level per subactor @@ -89,7 +91,7 @@ class ActorNursery: name: str, fn: typing.Callable, *, - bind_addr: Tuple[str, int] = ('127.0.0.1', 0), + bind_addr: Tuple[str, int] = _default_bind_addr, rpc_module_paths: Optional[List[str]] = None, statespace: Dict[str, Any] = None, loglevel: str = None, # set log level per subactor