Disable `greenback` sync fn breakpointing by def

Opting for performance over broad multi-actor "debug-ability" from
sync-function-contexts when `debug_mode=True` is set;
IOW prefer no behind-the-scenes `greenlet` perf impact over being
able to use an actor-safe `breakpoint()` wherever as per,
https://greenback.readthedocs.io/en/latest/principle.html#performance

Adjust the breakpoint restore ex script to match.
Tyler Goodlet 2025-06-11 19:50:29 -04:00
parent 37377e8220
commit 304117b4e1
2 changed files with 8 additions and 3 deletions

View File

@ -19,8 +19,11 @@ async def main() -> None:
async with tractor.open_nursery(
debug_mode=True,
loglevel='devx',
) as an:
assert an
maybe_enable_greenback=True,
# ^XXX REQUIRED to enable `breakpoint()` support (from sync
# fns) and thus required here to avoid an assertion err
# on the next line
):
assert (
(pybp_var := os.environ['PYTHONBREAKPOINT'])
==

View File

@ -166,7 +166,9 @@ async def open_root_actor(
# enables the multi-process debugger support
debug_mode: bool = False,
maybe_enable_greenback: bool = True, # `.pause_from_sync()/breakpoint()` support
maybe_enable_greenback: bool = False, # `.pause_from_sync()/breakpoint()` support
# ^XXX NOTE^ the perf implications of use,
# https://greenback.readthedocs.io/en/latest/principle.html#performance
enable_stack_on_sig: bool = False,
# internal logging