Flip to using the `trio` spawner on windows

Was able to try it manually on a windows 10 system and the debugger
works great!
use_trio_on_win
Tyler Goodlet 2020-11-16 00:16:09 -05:00
parent 2d0e35b316
commit 4259738864
1 changed files with 3 additions and 4 deletions

View File

@ -38,18 +38,17 @@ log = get_logger('tractor')
# placeholder for an mp start context if so using that backend
_ctx: Optional[mp.context.BaseContext] = None
_spawn_method: str = "spawn"
_spawn_method: str = "trio"
if platform.system() == 'Windows':
_spawn_method = "spawn"
_ctx = mp.get_context("spawn")
async def proc_waiter(proc: mp.Process) -> None:
await trio.lowlevel.WaitForSingleObject(proc.sentinel)
else:
# *NIX systems use ``trio`` primitives as our default
_spawn_method = "trio"
# *NIX systems use ``trio`` primitives as our default as well
async def proc_waiter(proc: mp.Process) -> None:
await trio.lowlevel.wait_readable(proc.sentinel)