Author asvetlov
Recipients asvetlov, fried, lukasz.langa, yselivanov
Date 2018-05-21.08:55:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1526892944.18.0.682650639539.issue33523@psf.upfronthosting.co.za>
In-reply-to
Content
Sorry, no.
The feature was requested many times but was constantly rejected.
By this, you are adding a BLOCKING call to your async function.
At least it leads to log warning about too long callback execution.

Moreover, I suspect that `run_until_complete` reentrancy requirement breaks the existing third-party loop implementations, not all loops can be fixed easily.

The last: calling blocking code from async code is the anti-pattern, asyncio explicitly discourages it.

You should convert all your stack to async functions and add sync stubs
when needed like

def sync_call(arg):
    asyncio.get_event_loop().run_until_complete(async_call(arg))

Yuri, do you agree with me?
History
Date User Action Args
2018-05-21 08:55:44asvetlovsetrecipients: + asvetlov, lukasz.langa, yselivanov, fried
2018-05-21 08:55:44asvetlovsetmessageid: <1526892944.18.0.682650639539.issue33523@psf.upfronthosting.co.za>
2018-05-21 08:55:44asvetlovlinkissue33523 messages
2018-05-21 08:55:44asvetlovcreate