forked from goodboy/tractor
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
parent
2d0e35b316
commit
4259738864
|
@ -38,18 +38,17 @@ log = get_logger('tractor')
|
||||||
|
|
||||||
# placeholder for an mp start context if so using that backend
|
# placeholder for an mp start context if so using that backend
|
||||||
_ctx: Optional[mp.context.BaseContext] = None
|
_ctx: Optional[mp.context.BaseContext] = None
|
||||||
_spawn_method: str = "spawn"
|
_spawn_method: str = "trio"
|
||||||
|
|
||||||
|
|
||||||
if platform.system() == 'Windows':
|
if platform.system() == 'Windows':
|
||||||
_spawn_method = "spawn"
|
|
||||||
_ctx = mp.get_context("spawn")
|
_ctx = mp.get_context("spawn")
|
||||||
|
|
||||||
async def proc_waiter(proc: mp.Process) -> None:
|
async def proc_waiter(proc: mp.Process) -> None:
|
||||||
await trio.lowlevel.WaitForSingleObject(proc.sentinel)
|
await trio.lowlevel.WaitForSingleObject(proc.sentinel)
|
||||||
else:
|
else:
|
||||||
# *NIX systems use ``trio`` primitives as our default
|
# *NIX systems use ``trio`` primitives as our default as well
|
||||||
_spawn_method = "trio"
|
|
||||||
|
|
||||||
async def proc_waiter(proc: mp.Process) -> None:
|
async def proc_waiter(proc: mp.Process) -> None:
|
||||||
await trio.lowlevel.wait_readable(proc.sentinel)
|
await trio.lowlevel.wait_readable(proc.sentinel)
|
||||||
|
|
Loading…
Reference in New Issue