Hi,

Similar to how Tornado has a IOLoop.current().run_sync method, is there 
anyway that while I'm in pdb I can schedule a coroutine or future, have it 
execute immediately, and block until it finishes?

For example, if I'm writing to a database and I need to test something, I'd 
like to be able to type within pdb "await db.insert(mydocument)" for 
testing purposes and have it execute immediately.

Just curious if this is even within the realm of possibility; I'm rather 
new to asyncio so I apologize if this has been discussed before or is 
completely preposterous.

I've tried to do things like, write a coroutine called "debug" such as:

async def debug():
    await db.insert(mydocument)

and then within pdb do something along the lines of 

loop.run_until_complete(debug())

but obviously this can't be done as the loop is already running.

Would love any insight on how to achieve this. Thanks!

Al

Reply via email to