-
Notifications
You must be signed in to change notification settings - Fork 166
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Things to check first
- I have searched the existing issues and didn't find my feature already requested there
Feature description
When using debugpy to debug a Python program, one might want the AnyIO socket selector thread (on Windows with the ProactorEventLoop) to keep running when the program is stopped on a breakpoint.
Use case
It's the case in ipykernel where I currently have to write something like that:
if backend == "asyncio" and sys.platform == "win32":
import asyncio
policy = asyncio.get_event_loop_policy()
if policy.__class__.__name__ == "WindowsProactorEventLoopPolicy":
from anyio._core._asyncio_selector_thread import get_selector
selector = get_selector()
selector._thread.pydev_do_not_trace = True
The key part is selector._thread.pydev_do_not_trace = True
, that ensures the thread is not suspended.
Do you think there should be a better API for that, or should it even be done by default?
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request