proxy.py icon indicating copy to clipboard operation
proxy.py copied to clipboard

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

Open James4Ever0 opened this issue 1 month ago • 0 comments

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?

James4Ever0 avatar Nov 17 '25 10:11 James4Ever0