Be explicit with the real name for trip

try_trip^2
Tyler Goodlet 2020-01-24 00:47:01 -05:00
parent 4837595e36
commit d9803ca906
2 changed files with 5 additions and 5 deletions

View File

@ -102,8 +102,8 @@ def run(
_default_arbiter_host, _default_arbiter_port), _default_arbiter_host, _default_arbiter_port),
# either the `multiprocessing` start method: # either the `multiprocessing` start method:
# https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods # https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods
# OR `trio-run-in-process` (the new default). # OR `trio_run_in_process` (the new default).
start_method: str = 'trip', start_method: str = 'trio_run_in_process',
**kwargs, **kwargs,
) -> Any: ) -> Any:
"""Run a trio-actor async function in process. """Run a trio-actor async function in process.

View File

@ -59,7 +59,7 @@ def try_set_start_method(name: str) -> mp.context.BaseContext:
# no Windows support for trip yet (afaik) # no Windows support for trip yet (afaik)
if platform.system() != 'Windows': if platform.system() != 'Windows':
allowed += ['trip'] allowed += ['trio_run_in_process']
if name not in allowed: if name not in allowed:
raise ValueError( raise ValueError(
@ -153,7 +153,7 @@ async def new_proc(
bind_addr: Tuple[str, int], bind_addr: Tuple[str, int],
parent_addr: Tuple[str, int], parent_addr: Tuple[str, int],
begin_wait_phase: trio.Event, begin_wait_phase: trio.Event,
use_trip: bool = False, use_trio_run_in_process: bool = False,
task_status: TaskStatus[Portal] = trio.TASK_STATUS_IGNORED task_status: TaskStatus[Portal] = trio.TASK_STATUS_IGNORED
) -> None: ) -> None:
"""Create a new ``multiprocessing.Process`` using the """Create a new ``multiprocessing.Process`` using the
@ -162,7 +162,7 @@ async def new_proc(
cancel_scope = None cancel_scope = None
async with trio.open_nursery() as nursery: async with trio.open_nursery() as nursery:
if use_trip or _spawn_method == 'trip': if use_trio_run_in_process or _spawn_method == 'trio_run_in_process':
# trio_run_in_process # trio_run_in_process
async with trio_run_in_process.open_in_process( async with trio_run_in_process.open_in_process(
subactor._trip_main, subactor._trip_main,