Merge pull request #166 from goodboy/use_trio_on_win
Flip to using the `trio` spawner on windowslogo_tweaks
commit
a868196d13
|
@ -0,0 +1,4 @@
|
||||||
|
Switch to using the ``trio`` process spawner by default on windows.
|
||||||
|
|
||||||
|
This gets windows users debugger support (manually tested) and in
|
||||||
|
general a more resilient (nested) actor tree implementation.
|
2
setup.py
2
setup.py
|
@ -24,7 +24,7 @@ with open('docs/README.rst', encoding='utf-8') as f:
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="tractor",
|
name="tractor",
|
||||||
version='0.1.0a2', # alpha zone
|
version='0.1.0a3.dev0', # alpha zone
|
||||||
description='structured concurrrent "actors"',
|
description='structured concurrrent "actors"',
|
||||||
long_description=readme,
|
long_description=readme,
|
||||||
license='GPLv3',
|
license='GPLv3',
|
||||||
|
|
|
@ -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