Nick Coghlan added the comment:

After trying out some example code in issue 24578, I've changed the suggestion 
function name to "call_async". The reason is because it makes this kind of code 
read quite well:

    futureB = asyncio.call_async(slow_io_bound_operation)
    futureC = asyncio.call_async(another_slow_io_bound_operation)
    a = calculateA()
    b = asyncio.wait_for_result(futureB)
    c = asyncio.wait_for_result(futureC)

And still reads well when combined with await:

    b = await asyncio.call_async(blocking_operation)

----------
title: [RFE] Add asyncio.call_in_executor API -> [RFE] Add asyncio.call_async 
API

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24571>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to