Skip to content

How to do non-blocking sleep in threadless mode in plugin #1534

@James4Ever0

Description

@James4Ever0

I can do time.sleep in before_upstream_connection. However, it only works flawlessly in threaded mode. In threadless mode it would block the entire event loop. I think the threadless mode is using asyncio, but I cannot tell how to do async sleep in threadless mode. Could you tell me how to implement it in the plugin?

Is there a decorator like mitmproxy.script.concurrent?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions