Skip to content

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

Open
@temeddix

Description

@temeddix

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())

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions