Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monitoring blocking time within event loop with set_debug() doesn't work #100

Open
temeddix opened this issue Nov 14, 2023 · 0 comments
Open

Comments

@temeddix
Copy link
Contributor

temeddix commented Nov 14, 2023

When using asyncio, we can find the blocking code like this:

import asyncio
import time


async def main():
    time.sleep(1)  # Block event loop

if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.set_debug(True)  # Enable debug
    loop.slow_callback_duration = 0.1
    loop.run_until_complete(main())
Executing <Task finished coro=<main() [...]> took 1.016 seconds

However, when using qasync, no output is printed even if there's blocking inside the event loop. I'm using macOS on Apple Silicon.

from qasync import QEventLoop
import time


async def main():
    time.sleep(1)  # Block event loop

if __name__ == "__main__":
    ...
    loop = QEventLoop(app)
    loop.set_debug(True)  # Enable debug
    loop.slow_callback_duration = 0.1
    loop.run_until_complete(main())
@temeddix temeddix changed the title Monitoring event loop for blocking doesn't work Monitoring event loop for blocking with set_debug() doesn't work Nov 14, 2023
@temeddix temeddix changed the title Monitoring event loop for blocking with set_debug() doesn't work Monitoring blocking time within event loop with set_debug() doesn't work Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant